RBX_pross_fan440872

Color Changing Gradient

Oct 2nd, 2021
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1.  
  2. --//VARIABLES
  3.  
  4. local GUI = script.Parent
  5. local Gradient = GUI.UIGradient
  6. local ts = game:GetService("TweenService")
  7. local t1 = TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut)
  8. local offset1 = {Offset = Vector2.new(1,0)}
  9. local create = ts:Create(Gradient, t1, offset1)
  10. local startingpos = Vector2.new(-1,0)
  11. local addWait = 0.5 -- Delay
  12.  
  13. --//ANIMATION
  14.  
  15. local function animate()
  16.     create:Play()
  17.     create.completed:wait() -- Waits for Tween To End
  18.     Gradient.Offset = startingpos -- Resets Offset
  19.     create:Play() -- Repeats Anim
  20.     create.completed:wait()
  21.     Gradient.Offset = startingpos
  22.     wait(addWait)
  23.     animate()
  24. end
  25.  
  26. animate()
Advertisement
Add Comment
Please, Sign In to add comment