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)
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