Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
sheepposu 561 Moderation Voter
5 years ago

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)
0
that should be done from the client not the server DeceptiveCaster 3761 — 5y
0
Also if you press GUI and see the properties there is something that says ResetOnSpawn. voidofdeathfire 148 — 5y
0
clinet? sheepposu 561 — 5y
0
GUIs are cloned locally theking48989987 2147 — 5y
View all comments (2 more)
0
Oh okay thx sheepposu 561 — 5y
0
Why is all this just in the comments. You think someone would have put it in as an answer Protogen_Dev 268 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

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

Ad
Log in to vote
0
Answered by
BryanFehr 133
5 years ago

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

Answer this question