I want a light to smoothly flicker, what I mean is when I want the transparency to go up, it scrolls across all the numbers going up, and when the transparency is at 1, it scrolls down.
My code works, but it's really long.
while true do -- out wait(0.01) script.Parent.ImageTransparency = .1 wait(0.01) script.Parent.ImageTransparency = .2 wait(0.01) script.Parent.ImageTransparency = .3 wait(0.01) script.Parent.ImageTransparency = .4 wait(0.01) script.Parent.ImageTransparency = .5 wait(0.01) script.Parent.ImageTransparency = .6 wait(0.01) script.Parent.ImageTransparency = .7 wait(0.01) script.Parent.ImageTransparency = .8 wait(0.01) script.Parent.ImageTransparency = .9 wait(0.01) script.Parent.ImageTransparency = 1 wait(0.01) -- in script.Parent.ImageTransparency = .9 wait(0.01) script.Parent.ImageTransparency = .8 wait(0.01) script.Parent.ImageTransparency = .7 wait(0.01) script.Parent.ImageTransparency = .6 wait(0.01) script.Parent.ImageTransparency = .5 wait(0.01) script.Parent.ImageTransparency = .4 wait(0.01) script.Parent.ImageTransparency = .3 wait(0.01) script.Parent.ImageTransparency = .2 end
Please tell me what I need to do.
while (true) do for i=.1,10 do script.Parent.ImageTransparency = i; wait(0.02); end for i=1,10 do script.Parent.ImageTransparency = 1 - i; wait(0.02); end end;
Boom. Should work now.