Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How come my fade-out/Visible script won't work at all?

Asked by 4 years ago

So I have a script where it will make an image label fade-out then it makes another image label visible I don't know what went wrong, and I also have an error.

---script---

local fadeTime = 10 -- seconds
local smoothness = 100 -- how many times the loop would run

if script.Parent.Parent.Visible == true then     
for i=1, smoothness do
    ImageLabel3.ImageTransparency = ImageLabel3.ImageTransparency + fadeTime/smoothness
    wait(fadeTime/smoothness)
if script.Imagelabel3.Visible == true then
    script.ImageLabel3.Visible = false
    wait(0.5)
if script.ImageLabel3.Visible == false then
    script.ImageLabel.Visible = true
end 
end

---Error---

11:52:29 -- Player.vincentthecat1.PlayerGui.ScreenGui.FramePre2.ImageLabel3.LocalScript:14: (to close 'for' at line 5) near '<eof>'
0
Did you make sure you added enough ends? iinaoriku 52 — 4y

1 answer

Log in to vote
0
Answered by
poke7667 142
4 years ago
Edited 4 years ago

You forgot to add an extra end to close one of your if statements:

local fadeTime = 10 -- seconds
local smoothness = 100 -- how many times the loop would run

if script.Parent.Parent.Visible == true then     
for i=1, smoothness do
    ImageLabel3.ImageTransparency = ImageLabel3.ImageTransparency + fadeTime/smoothness
    wait(fadeTime/smoothness)
if script.Imagelabel3.Visible == true then
    script.ImageLabel3.Visible = false
    wait(0.5)
end -- you forgot to close this if statement with an end
if script.ImageLabel3.Visible == false then
    script.ImageLabel.Visible = true
end 
end
0
oh vincentthecat1 199 — 4y
Ad

Answer this question