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

visible script is not working can someone help me? Your title should be specific!

lmao how does this have 6+ upvotes wtf 8 upvotes you guys have aids

here's the script

while wait(1) do
	local OrderNumber = script.Parent
if OrderNumber.Order2Handler.Visible == true then
	OrderNumber.Order1Handler.Visible = true
if OrderNumber.Order3Handler.Visible == true then
	OrderNumber.Order1Handler.Visible = true
	OrderNumber.Order2Handler.Visible = true
if OrderNumber.Order4Handler.Visible == true then
	OrderNumber.Order1Handler.Visible = true
	OrderNumber.Order2Handler.Visible = true
	OrderNumber.Order3Handler.Visible = true
if OrderNumber.Order5Handler.Visible == true then
	OrderNumber.Order1Handler.Visible = true
	OrderNumber.Order2Handler.Visible = true
	OrderNumber.Order3Handler.Visible = true
	OrderNumber.Order4Handler.Visible = true
end
end
end
end
end

it didnt work. help?

14 comments

2

did you put the script inside the gui inside startergui ?

4

yes

2

and is that a server or a local script

4

this is a local script 

2

did you get any errors?

4

no

4

no

4

no

2

if the first if statement passes does order1handler turn visible

2

if it does then i think i found your problem, im gonna try to answer

2

the while wait part looks strange to me, is there a reason for the while loop?

1

i think he's just trying to check repeatedly

1

how do all my coments have 3 upvotes............

0

POOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOP

1 answer

✓ Accepted answer

This is a working local script inside the gui.

while wait(1) do
    local OrderNumber = script.Parent
	
	if OrderNumber.Order2Handler.Visible == true then
    	OrderNumber.Order1Handler.Visible = true
	end
	
	if OrderNumber.Order3Handler.Visible == true then
    	OrderNumber.Order1Handler.Visible = true
    	OrderNumber.Order2Handler.Visible = true
	end

	if OrderNumber.Order4Handler.Visible == true then
    	OrderNumber.Order1Handler.Visible = true
    	OrderNumber.Order2Handler.Visible = true
    	OrderNumber.Order3Handler.Visible = true
	end
	
	if OrderNumber.Order5Handler.Visible == true then
    	OrderNumber.Order1Handler.Visible = true
    	OrderNumber.Order2Handler.Visible = true
    	OrderNumber.Order3Handler.Visible = true
    	OrderNumber.Order4Handler.Visible = true
	end

end

Why your script didn't work

while wait(1) do
    local OrderNumber = script.Parent
if OrderNumber.Order2Handler.Visible == true then
    OrderNumber.Order1Handler.Visible = true
if OrderNumber.Order3Handler.Visible == true then
    OrderNumber.Order1Handler.Visible = true
    OrderNumber.Order2Handler.Visible = true
if OrderNumber.Order4Handler.Visible == true then
    OrderNumber.Order1Handler.Visible = true
    OrderNumber.Order2Handler.Visible = true
    OrderNumber.Order3Handler.Visible = true
if OrderNumber.Order5Handler.Visible == true then
    OrderNumber.Order1Handler.Visible = true
    OrderNumber.Order2Handler.Visible = true
    OrderNumber.Order3Handler.Visible = true
    OrderNumber.Order4Handler.Visible = true
end
end
end
end
end

So you have if statements inside other if statements. That's called nesting. Here if the first if statement passes then it will set the value to true and check the second if statement and so on; but if it doesn't pass , it won't check the other if statements, which I guess is bad.

In the working script, if the first if statement passes then it will set the value to true and then check the 2nd if statement and so on. If it doesn't pass it will still check the 2nd if statement. The same thing happens with the 2nd if statement.

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