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

How do I make another ScreenGui pop up when I click a GUI in a different ScreenGui?

Asked by 4 years ago
Edited 4 years ago

Ok so I never really made a game before so I don't know what it's like to script in a good game and here's my code:

if game.StarterGui.PlayScreen.PlayBackround.Visible = false then game.StarterGui.FirstTest.TestFrame.Visible = true print ("This Worked") end

And for some reason the Output says that it wants a then cause there's an if statement, like I LITERALLY PUT A THEN STATEMENT RIGHT THERE!

0
Like I seriously don't know why the output says it needs a then statement huntergamind 2 — 4y
0
you spelt background wrong COMBATKOALA 5 — 4y
0
It is because you only have 1 equal sign in line 1. I gave you an answer that should fix the error you have now Heavenlyblobmaster 271 — 4y
0
In programming languages, the equal sign is no longer interpreted as a numerical figure, but as an operand called assign. When using conditional statements, you need to use the comparison operator, which is ==. In some other languages you have the exact operator: === Ziffixture 6913 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You need "==" when writing an if statement.

if game.StarterGui.PlayScreen.PlayBackround.Visible == false then -- 2  equal signs 
game.StarterGui.FirstTest.TestFrame.Visible = true 
print ("This Worked") 
end

If this answers your question, mark as answer ;).

0
um i never tested it yet so wait ok :) huntergamind 2 — 4y
0
ok i tested it and sorry it didnt work but the output didnt say "you need a THEN" well obviously the output didnt actually say that but it didnt work :[ huntergamind 2 — 4y
Ad

Answer this question