Teleport script only teleports one person

No I meant like my code is like this:

     '''
          while true do
          --blah blah
        --ends

          '''

I’ve just tested @LordMerc script and it should work. Have you copied it correctly?

If it doesnt work you can try this:

local Position = -- This could be Cframe or a Vector3 (Random Position)
	for i, players in ipairs(game.Players:GetChildren()) do
		if players.Character:FindFirstChild("HumanoidRootPart") then
		players.Character:FindFirstChild("HumanoidRootPart").Position = Position
	end
end

You can also use the search bar to look up other posts just like this.

1 Like

Like I said above, it will only teleport one person because of the how script looks:

  '''
     while true do
         --blah blah
    --ends

       '''
for i,v in pairs(game.Players:GetChildren()) do
	v.Character.HumanoidRootPart.CFrame = CFrame.new(workspace.Part.Position)
end

This works fine, use this.

Show the round script (30 chars)

U can use this in your round script becuase it loops.

Please read my post the one before your post… Please read carefully

How exactly can I work with that script?

You would have to loop that and then prevent the script from looping all over again to the start of the script

You could try doing .Position instead of CFrame

So the only solution is to teleport all players at once

You are already doing that with that code

Isn’t that what you wanted from the start?

for i,v in pairs(game.Players:GetChildren()) do
v.Character.HumanoidRootPart.Position = workspace.LoadedMap.SpawnPlayersToMap.Position
end

(Note that the SpawnPlayersToMap needs to be a part)

while true do
wait(MatchRoundDuration)
for i,v in pairs(game.Players:GetChildren()) do
	v.Character.HumanoidRootPart.CFrame = CFrame.new(workspace.Part.Position)
end
end

@Kamlkaze_Kid Are you looking for this?

Make if char before teleporting them

LOL, now that im thinking you asked for that everyone gets teleported not something else.

My scripts works fine without if char :wink:

Sometimes it takes longer to load the character

I think without the loop would work maybe game.Players:GetChildren()?

It is always proper to check if the character exists. What if the player dies right when it teleports? The script is gonna throw an error and stop working