I am making a round based game and once the game starts all the players should teleport to a specific location however for some reason when I test it, with a couple of players only like 2 players actually get teleported while the rest just don’t for some reason.
for _, Plr in next, plrs do
wait()
Plr.Character.HumanoidRootPart.CFrame = TelePart.CFrame
end
This is what I have so far, obviously plrs is a table of all the players in the server and this table is made 10 seconds after every player has joined the server. I don’t really know why this happens because it seems very simple and I also get no errors.
local Players = game:GetService('Players')
local TelePart = workspace['TelePart'] -- Or the name of it!
for _, Plr in ipairs(Players:GetPlayers()) do
Plr.Character.HumanoidRootPart.CFrame = TelePart.CFrame
end
wait()
The wait is yielding (I believe) 0.05 seconds per player being looped, which will slow your game down by 0.05 * NumberOfPlayers. Now if players are joining after the loop has completed, it won’t teleport them; You’ll need to add a wait to assure all players have loaded in before teleporting them.