I need a way to distinguish if the player disconnected from the game or teleporting to another server.
Yes, it will still fire PlayerRemoving.
To be fair, if they are teleporting to another server, then that means that your code somewhere is teleporting them. Thus, you should still be able to distinguish this quite easily since you have control over the teleportation process.
Yes, I’m trying to work it out via that method.
I’m trying to make a 4-players squad system to work cross-servers and it needs a way to tell if a player is teleporting or disconnected from the game so it can free up the slot in the squad.
Currently I’ll just use a 10 seconds delay on game.Players.PlayerRemoving to check 10 seconds later if the player is still in the same universe.
Does Player.OnTeleport fire before or after game.Players.PlayerRemoving?
Edit: Great! It does, thanks @Scriptos.