I have a round script, it loop checks if there are >1 player's, or <1 players, and if there's 2 players, starts the round. It works fine, except it teleports 1 player, instead of all of them. Here's the script, try to tell me what's wrong please, I can't check output because it needs 2+.
while wait() do
if game.Players.NumPlayers > 1 then
wait(5)
game.Workspace.lobby.timer.SurfaceGui.timelft.Text = "Starting New Round..."
wait(3)
game.Workspace.lobby.timer.SurfaceGui.timelft.Text = "Spawning Players..."
wait(1)
for i,v in pairs(game.Players:GetPlayers()) do
local coordinates = {Vector3.new(-80.9, 3.2, -286.5), Vector3.new(1.64, 3.2, -179.7), Vector3.new(83.5, 3.2, -287.5), Vector3.new(2.44, 3.2, -396.5)}
local randomCoor = coordinates[math.random(#coordinates)]
local knife = game.ServerStorage.Knife:Clone()
v.Character.Torso.CFrame = CFrame.new(randomCoor)
v.Character.Torso.Anchored = true
knife.Parent = v.Backpack
wait(4)
v.Character.Torso.Anchored = false
end
wait(60)
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Humanoid.Health = 0
end
wait(5)
game.Workspace.lobby.timer.SurfaceGui.timelft.Text = "Round Finished!"
end
if game.Players.NumPlayers < 2 then
game.Workspace.lobby.timer.SurfaceGui.timelft.Text = "This game requires 2+ Players."
wait(1)
game.Workspace.lobby.timer.SurfaceGui.timelft.Text = "This game requires 2+ Players.."
wait(1)
game.Workspace.lobby.timer.SurfaceGui.timelft.Text = "This game requires 2+ Players..."
wait(1)
end
end
Can you try to see what's wrong? It only teleports 1 player. It kills all the players though, and gives all players the knife, when the round begins.

3 comments
Thanks, I will try this :)
If it does't work then we need to rewrite the entire code!
I got it, instead of Torso.CFrame, use Character:MoveTo(randomCoor), because if you move ONLY the torso, the player will be killed =)