Advertisement
RyanDolan123

Untitled

Apr 26th, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. function TweenBackgroundColor3(element,starta,enda,length) --i mad dis tho
  2.     local r1,g1,b1,r2,g2,b2 = starta.r,starta.g,starta.b,enda.r,enda.g,enda.b
  3.     coroutine.resume(coroutine.create(function()
  4.         local startTime = time()
  5.         while time() - startTime < length do
  6.             local ya = ((time() - startTime)/length)
  7.             element.BackgroundColor3 = Color3.new(
  8.                 ((r2 - r1) * ya) + r1,
  9.                 ((g2 - g1) * ya) + g1,
  10.                 ((b2 - b1) * ya) + b1
  11.             )
  12.             wait(.01)
  13.         end
  14.         element.BackgroundColor3 = enda
  15.     end))
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement