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.

4 comments

0

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.

0

Its because you aren't targeting the players gui but the GUI players get when joining the game

0

everyone has a seperate startergui inside their player, use that instead of game.StarterGui

0

Player.PlayerGui is what you are looking for