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

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

Asked by
raid6n 2196 Moderation Voter Community Moderator
5 years ago
Edited 4 years ago

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

here's the script

01while wait(1) do
02    local OrderNumber = script.Parent
03if OrderNumber.Order2Handler.Visible == true then
04    OrderNumber.Order1Handler.Visible = true
05if OrderNumber.Order3Handler.Visible == true then
06    OrderNumber.Order1Handler.Visible = true
07    OrderNumber.Order2Handler.Visible = true
08if OrderNumber.Order4Handler.Visible == true then
09    OrderNumber.Order1Handler.Visible = true
10    OrderNumber.Order2Handler.Visible = true
11    OrderNumber.Order3Handler.Visible = true
12if OrderNumber.Order5Handler.Visible == true then
13    OrderNumber.Order1Handler.Visible = true
14    OrderNumber.Order2Handler.Visible = true
15    OrderNumber.Order3Handler.Visible = true
View all 21 lines...

it didnt work. help?

2
did you put the script inside the gui inside startergui ? Lazarix9 245 — 5y
4
yes raid6n 2196 — 5y
2
and is that a server or a local script Lazarix9 245 — 5y
4
this is a local script  raid6n 2196 — 5y
View all comments (10 more)
2
did you get any errors? Lazarix9 245 — 5y
4
no raid6n 2196 — 5y
4
no raid6n 2196 — 5y
4
no raid6n 2196 — 5y
2
if the first if statement passes does order1handler turn visible Lazarix9 245 — 5y
2
if it does then i think i found your problem, im gonna try to answer Lazarix9 245 — 5y
2
the while wait part looks strange to me, is there a reason for the while loop? AndriusTheGreat 140 — 5y
1
i think he's just trying to check repeatedly Lazarix9 245 — 5y
1
how do all my coments have 3 upvotes............ raid6n 2196 — 4y
0
POOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOP raid6n 2196 — 4y

1 answer

Log in to vote
2
Answered by
Lazarix9 245 Moderation Voter
5 years ago

This is a working local script inside the gui.

01while wait(1) do
02    local OrderNumber = script.Parent
03 
04    if OrderNumber.Order2Handler.Visible == true then
05        OrderNumber.Order1Handler.Visible = true
06    end
07 
08    if OrderNumber.Order3Handler.Visible == true then
09        OrderNumber.Order1Handler.Visible = true
10        OrderNumber.Order2Handler.Visible = true
11    end
12 
13    if OrderNumber.Order4Handler.Visible == true then
14        OrderNumber.Order1Handler.Visible = true
15        OrderNumber.Order2Handler.Visible = true
View all 26 lines...

Why your script didn't work

01while wait(1) do
02    local OrderNumber = script.Parent
03if OrderNumber.Order2Handler.Visible == true then
04    OrderNumber.Order1Handler.Visible = true
05if OrderNumber.Order3Handler.Visible == true then
06    OrderNumber.Order1Handler.Visible = true
07    OrderNumber.Order2Handler.Visible = true
08if OrderNumber.Order4Handler.Visible == true then
09    OrderNumber.Order1Handler.Visible = true
10    OrderNumber.Order2Handler.Visible = true
11    OrderNumber.Order3Handler.Visible = true
12if OrderNumber.Order5Handler.Visible == true then
13    OrderNumber.Order1Handler.Visible = true
14    OrderNumber.Order2Handler.Visible = true
15    OrderNumber.Order3Handler.Visible = true
View all 21 lines...

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.

Ad

Answer this question