Creating a lobby where players return to after death

I need help scripting for making a lobby and after the player dies they return to the lobby.

1 Like

Just put a spawnpoint in the lobby, make it neutral and make sure there are no other spawnpoints on the map and whenever they die, they should respawn there.

1 Like

Hello! Alrighty, this is not the correct category but anyway!
You can use Player.CharacterRemoving function! Let me show you

local Players = game:GetService("Players")
local Spawns = workspace["Spawns"]:GetChildren() -- Make a folder with parts inside, Change "Spawns" to your foulder name.

Players.PlayerAdded:Connect(function(plr) -- The player parameter( the player which joined game! )
plr.CharacterAdded:Connect(function(Character) -- If the character leaves games or has died and has respawned.
if Character.PrimaryPart then -- Just using the character primary part to move it!
Character:SetPrimaryPartCFrame(Spawns[math.random(1, #Spawns)].CFrame) -- Here we are setting player position to make it random trough all the spawns, so, if you die, you mifht spawn on the first one, second one, third one... etc! 

Hope I could help you~


@ignacasas06 Thank you for helping me! I appreciate it.


No problem, you’re welcome. :slight_smile:

1 Like