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

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

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!

4 comments

0

Like I seriously don't know why the output says it needs a then statement

0

you spelt background wrong

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

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: ===

1 answer

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 ;).

2 comments

0

um i never tested it yet so wait ok :)

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 :[

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