How to make this teleport all players script work 100% of the time?

This is apart of a round script, at the start of the round it teleports all players to the map, and it works but during some rounds it will miss one player and not teleport them, and sometimes that breaks the round script completely. I also have it at the end of the round script for teleporting all players back to the lobby, so i need that to work 100% too.

	for i, Player in pairs(game.Players:GetPlayers()) do
		local Character = Player.Character

		if Character then
			local HumanoidRootPart = Character.HumanoidRootPart
			HumanoidRootPart.CFrame = ClonedMap.TeleportPoint.CFrame

1 Like
for _,v in game:GetService("Players"):GetPlayers() do
    local Character = v.Character
    if Character then
       Character:MoveTo(ClonedMap.TeleportPoint.Position)
    end
end

You can use Player.Character or Player.CharacterAdded:Wait(). The second part waits for a player’s character to spawn if it does not exist.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.