Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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>'

1 comment

0

Did you make sure you added enough ends?

1 answer

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

1 comment

0

oh

This discussion is preserved as it was. New answers, comments, and votes are closed.