Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by 9 years ago

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?

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

1 answer

Log in to vote
0
Answered by
RoboFrog 400 Moderation Voter
9 years ago

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.

Ad

Answer this question