How to make a player spawn only when Play button is pressed?

Hi guys,

I have a problem where I want it so that the game only starts when the play button is pressed.

1 Like

I’m pretty sure you can set CharacterAutoLoads (Property of game.Players) to false so they will not respawn, then you can use Player:LoadCharacter() to make them respawn.

Where would you find LoadCharacter?

LoadCharacter isn’t a property, It’s a function of player that basically respawns it.

Since when you disable CharacterAutoLoads the StarterGui does not get automatically copied to PlayerGui, I recommend using colbert’s solution:

After you are good with the GUI, you can place a localscript on it that triggers a RemoteEvent on the Server which uses LoadCharacter on the player who called.
Here I put the RemoteEvent in workspace and a ServerScript inside it. (Feel free to change the location)

--LocalScript inside GUI
local Button = script.Parent
Button.MouseButton1Click:Connect(function()
	workspace.LoadEvent:FireServer()
end)
--ServerScript inside the RemoteEvent
script.Parent.OnServerEvent:Connect(function(Player)
	Player:LoadCharacter()
end)

Becareful though, exploiters may abuse this.
Also keep in mind disabling CharacterAutoLoads will cause players to not automatically respawn anymore, which you will have to make a script for them to respawn.

Hello, I know its been a year but, how might I do this when a player joins but also load the UI so that they can press play?