✓ 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.
14 comments
did you put the script inside the gui inside startergui ?
yes
and is that a server or a local script
this is a local script
did you get any errors?
no
no
no
if the first if statement passes does order1handler turn visible
if it does then i think i found your problem, im gonna try to answer
the while wait part looks strange to me, is there a reason for the while loop?
i think he's just trying to check repeatedly
how do all my coments have 3 upvotes............
POOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOP