play = game.Players:GetChildren() for i = 1,#play do if p[i] ~= nil then if play[i].TeamColor == game.Teams.Runners.TeamColor then char = play[i].Character if char ~= nil then torso = char:findFirstChild("Torso") if torso ~= nil then torso.CFrame = game.Workspace.RunnerSpawn.CFrame + Vector3.new(math.random(-6, 6), 0, math.random(-6, 6)) wait(0.025) end end
When this script is fired and their are more than 2 people on the Runners team, only 1 one of them are teleported. I am trying to figure out why it won't teleport more than 1 people to the Spawn. Can anyone help me?
I believe your problem is that you are missing several end
s.
Here is your code with the correct amount:
play = game.Players:GetChildren() for i = 1,#play do if play[i] ~= nil then if play[i].TeamColor == game.Teams.Runners.TeamColor then char = play[i].Character if char ~= nil then torso = char:findFirstChild("Torso") if torso ~= nil then torso.CFrame = game.Workspace.RunnerSpawn.CFrame + Vector3.new(math.random(-6, 6), 0, math.random(-6, 6)) wait(0.025) end end end end end
Also, p[i]
has not been defined. I have changed it to play[i]
so it would work.