Players not being successfully teleported

I had some people in war groups reach out to me and asked me if they could use one of my places as a rally for their events since I had access to 100 player servers. The use of a rally place is you gather up everyone and then teleport them all to one place at once for a blitzkrieg-esque attack. Whenever they try to teleport everyone in the server though, some people are always left behind (I’m always left in the server, for instance). I’m not sure what the cause is, but if I look in the server log, I see some weird warnings/errors:

Here’s the code used to teleport the entire server to the place:

local teleporting
game.ReplicatedStorage:WaitForChild("TeleportAll").OnServerEvent:connect(function(invoker)
	if invoker.TeamColor == BrickColor.new("Bright orange") and not teleporting then
		teleporting = true
		for i,v in next,game.Players:GetPlayers() do
			game:GetService("TeleportService"):Teleport(setPlace, v)
		end
	end
end)

Most of the server gets teleported, so that code is most certainly being executed – it’s just for some reason some people like myself don’t ever get teleported. Maybe it’s because the place is a 100-player-server – I don’t know. Here’s a link to the place.

The errors you see are just regular errors for DataPersistence.
ROBLOX could hide them, since those warnings/errors ALWAYS popup, but eh…

Didn’t you get an oldskool Message(-instance) on your screen about “Teleporting…” and maybe an error?
Errors for teleporting are also shown in the Local Log, as it is the client that actually teleports.
(Calling the method serverside is just making the server tell the client to call the method)

Don’t use DP at all in the place

Nope – no message (instance) at all. I’ll check the local log next time though.

It appears in any place, DP or not.
Everytime someone joins, it appears.

If even the local log is empty, it means you actually don’t get tp’ed.
Maybe the serverside :Teleport() has a limit on how much it can be called in one (network?) tick?

Have you tried using the OnTeleport event to retry if a teleport fails?

Teleporting a player can fail for a number of reasons and you can handle this failure by retrying while waiting a few seconds between each retry.

1 Like

Thanks, I’ll try using that. Btw, on that page I noticed there’s a characteradded event in the example code on that page which doesn’t seem to do anything – I would assume not, but to be on the safe side, there isn’t some hidden gotcha that the characteradded event is placed there to avert, right? playerOnTeleport = player doesn’t seem important either.

1 Like

No reason for that event to be there. I decided to remove it from the page as it just makes the code more complicated.

1 Like

Well… if you want to teleport a player from the server, you would use the player object or its character.
Internally, when you use the player object, it just calls itself with player.Character (well, it seems like).
If the player has no character, the teleport will fail.
That was the case some time ago… knowing roblox, it probably isn’t fixed?