Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you spawn character when they join the server or die?

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?

1 comment

0

This Is an Lua Script, ok?? I need help with the lase = sign cause It keep saying error or something :C

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.