I'm making a game, and I'm trying to create a button that closes out the main menu gui. I made function and in the function I put the code, game.StartGui.ScreenGui.Enabled = false. But when I tested the code, it wouldn't work. It would be awesome if someone were to explain to me what it is that I did wrong.
COMMUNITY QUESTION
Why won't my script, game.StarterGui.ScreenGui.Enabled = false, work?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
game.StarterGui is just a container and not all the guis on the game. You might try placing a script inside the screen gui instead.
Its because you aren't targeting the players gui but the GUI players get when joining the game
everyone has a seperate startergui inside their player, use that instead of game.StarterGui
Player.PlayerGui is what you are looking for