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

Why won't my Gui Enable? (Extra Spaces for Submission)

I have a Gui, my start menu. It pops back up after death. So to solve this problem I made a script to enable the Gui when hey enter the game so when they die it will stay disabled because that's how it started. I confused about why it won't work.

This is the script I put in ServerScriptService and it is spelled correctly. The error is "StartMenu is not a valid member of PlayerGui"

game.Players.PlayerAdded:Connect(function(player)
	player.PlayerGui.StartMenu.Enabled = true
end)

6 comments

0

that should be done from the client not the server

0

Also if you press GUI and see the properties there is something that says ResetOnSpawn.

0

clinet?

0

GUIs are cloned locally

0

Oh okay thx

0

Why is all this just in the comments. You think someone would have put it in as an answer

2 answers

As mentioned in the comments, you would want to put it into the starterplayer instead of doing it from the server. Roblox is wierd

Place your script in StarterPlayer instead of ServerScriptService, as the script won't function because of it being ran on the client side. If you have a button which closes your StartMenu, I'd suggest making that button disable the StartMenu after click, so that it only appears on PlayerAdded. Like so;

script.Parent.Spawn.MouseButton1Click:connect (function ()
script.Parent.Enabled = false

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