Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TweenBackgroundColor3(element,starta,enda,length) --i mad dis tho
- local r1,g1,b1,r2,g2,b2 = starta.r,starta.g,starta.b,enda.r,enda.g,enda.b
- coroutine.resume(coroutine.create(function()
- local startTime = time()
- while time() - startTime < length do
- local ya = ((time() - startTime)/length)
- element.BackgroundColor3 = Color3.new(
- ((r2 - r1) * ya) + r1,
- ((g2 - g1) * ya) + g1,
- ((b2 - b1) * ya) + b1
- )
- wait(.01)
- end
- element.BackgroundColor3 = enda
- end))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement