This is a local script that uses the function "for i" to change transparency. It does not work, it does not even show any errors in output or script analysis. Help!
Here is the script:
local gui = script.Parent local frame = gui.Frame local warning = frame.Warning warning.ImageTransparency = 1 while true do wait() for i = 0, 1, 0.1 do warning.ImageTransparency = i end wait() for i = 1, 0, 0.1 do warning.ImageTransparency = i end end
Your script is mostly working, but it's doing its job very quickly.
It assigns transparency to 0, then 0.1, then 0.2, then 0.3, then 0.4, then 0.5, ...., then 1.
But it does all of that without pausing, so you will only be able to see the last assignment.
You need a wait()
inside your loop in order to see it.
In order to count backwards, you have to say -0.1
instead of 0.1
.
Tab your code correctly -- it makes it much easier to figure out which things belong to which loops / conditions.
while true do for i = 0, 1, 0.1 do warning.ImageTransparency = i wait() -- added end for i = 1, 0, -0.1 do -- 0.1 should be -0.1 warning.ImageTransparency = i wait() -- added end end