function SpawnPlayer() local spawns = Workspace["Spawn Players"]:WaitForChild("Spawnz"):GetChildren() for _, player in pairs[contestants] do if player and player.Character and #spawns > 0 then torso = player.Character:WaitForChild("Torso") local spawnedIndex = math.random(1, #spawns) local spawn = spawns[spawnIndex] if spawn and torso then table.remove(spawns, spawnedIndex) torso.CFrame = CFrame.new(spawn.Position = Vector3.new(0,3,0)) end
Can anyone help me script when u players die I want em to spawn different from different spawn instead on top of each others plus when they join too. Should This be an Local Script and where should it be?
First off, please use the "Lua" button when posting code to allow us to actually read it.
Second, you can use the PlayerAdded event to allow a function to run on join.
If you use that event, the script has to be a regular script, not a LocalScript
.