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

teleport all players script not working?

Asked by 8 years ago

So I'm working on a survive the disasters game and I'm making a "teleport all players" so I can teleport them to a map and then back after the disaster is over but my script isn't working. could some one please fix it and explain what I did wrong?

for I = 1, #players do Players(I).Character.Torso:Moveto(502.352, 1.95, 51.291) end

1 answer

Log in to vote
0
Answered by 8 years ago
target = CFrame.new(0, 50, 0) --where they teleport position
for i, player in ipairs(game.Players:GetChildren()) do
   if player.Character and player.Character:FindFirstChild("Torso") then
      player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0)
   end
end

your welcome

Ad

Answer this question