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

Can you tell me what is wrong with this?

-- This is inside of a TextBox that is inside of a Frame that is inside of a ScreenGui
local t = script.Parent
	if t.Text = "100%" then
	wait(2)
	t.Parent.Visible = false
	t.Visible = false
end

On line 3 it is underlined with red but I can't figure out what is wrong. Any help? (P.S.) This is for a loading screen so when it says 100% the gui is supposed to close.

2 answers

✓ Accepted answer
local t = script.Parent
if t.Text == "100%" then --If your using an if loop, make sure to add two ='s if it equals to a value of somesort.
 wait(2)
t.Parent.Visible = false
 t.Visible = false
end

Try using single quotes instead of double quotes. Or turn the "t.Text = "100%" " to a variable. So if (var) then -->

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