Preventing player spawn

I’m trying to prevent my game from spawning the player until they’ve confirmed something on a GUI, or maybe even not spawn them at all. I’m not entirely sure how to go about this, and my search through the dev forum hasn’t come up with much. I don’t doubt it exists, but I haven’t been able to find it. Any help would be appreciated.

1 Like

go to the player object and set the respawn time to 903248794389324432890342890432890342089

2 Likes

Will this allow them to still use UIs, or will they be unable to do anything at all until they’ve respawned?

they wont be able to move. But you could make a script where the Ui will pop up when the player dies so yes.

1 Like

Right. And is there a way to prevent the player from spawning when they first launch the game? The respawn timer only seems to apply to respawns after the initial spawn.

Yes you could do that.e…eeeeee

…Yes. I know. I am asking how to stop them from spawning the FIRST time. So when they join, they don’t spawn until a certain condition has been met.

oh, just make a spawn location really far away from the map and make it so they move to a spawn after they do something.

I found the CharacterAutoLoads toggle. I’m going to try that.

Yeah I was going to say that is what you are looking for.

To spawn the player simply do

Player:LoadCharacterBlocking()

or

Player:LoadCharacterWithHumanoidDescription()

or

Player:LoadCharacter()

1 Like

Yeah, this seems like the right direction, but the issue there is if I disable CharacterAutoLoads, the GUI doesn’t actually appear.

AHA! I managed to clone the GUI to the local player in my setup script. Hopefully this works.

Yes we’ll when a character is loaded everything in the Player backpack is reset and everything in the players GUI is reset too.

It’s a little annoying but the way to get around it is to make a Script (I recommend ReplicatedFirst which manually copies all StarterGUIi into player GUI

Oh and don’t forget to tick ResetOnSpawn for your ScreenGuis to be false too.

2 Likes

Sorry, here’s an example of what I did, for anyone reading this:

local function onPlayerJoin(player)
	
	-- CLONE GUI --
	-- Clones the GUI to the local player, so they can actually see it. --
	local gui = player:WaitForChild("PlayerGui")
	local gameGui = game.StarterGui.ScreenGui:clone()
	gameGui.Parent = gui
end

game:GetService('Players').PlayerAdded:Connect(onPlayerJoin)
5 Likes