I dont really know why this isnt working why cant i do like this when i clicked on the textbutton then i close the gui but it dosent seem to work. Heres the code
function onClick()
game.StarterGui.ChooseLevel.Main.Visible = false
end
script.Parent.MouseButton1Click:connect(onClick)

8 comments
It gives me this error "Localplayer is not a valid member of DataModel" and i want the gui to show up when a new player joins i dont want it to be like open first i want it to be like if i join the server then the gui is there on the start
Wait, i should've asked this first before posting my answer... Where do you have the script? Is it a Local script?
its in a textbutton, and no its not a local script
Is the textbutton on a brick? Or on the players screen?
on the players screen
Just a heads up. It's "game.Players.LocalPlayer". Not "game.LocalPlayer"
Oh that's right! Thanks @TheHospitalDev. I just edited my post.
Another question, where do you have the textbutton along with the script? Inside Workspace or inside the StarterGUI? If you could provide a picture with how you have it set-up then it would be much easier to help you. This is only if you are absolutely sure you want to have it this way. Otherwise, read ScripterTonys answer up above. Do what he says, and then put the textbutton along with the scrip