So this is my code for creating a reserved server and teleporting players into them. It works just fine most of the time… but occasionally (maybe 1/4-1/10 of the time) it just fails for some reason. Players begin to teleport but don’t actually go anywhere. (PS: I have two for loops because _G.SaveData needs to save all the player data, and the StartMatch function needs to run on all the clients first)
Anyone know if this is something I’m doing wrong? I’ve even tried sending the players out 1 by 1 but that didn’t seem to help. Players still occasionally don’t get teleported for some reason.
Then retry the teleport when it fails (teleportState == Enum.TeleportState.Failed). Make sure to store the arguments to the last teleport attempt of that player so that you can actually retry it (since you don’t get the parameters back in the event handler).
PS: Don’t post in Bugs and Exploit Reports unless you are sure that you’ve found a bug and/or if you have a clear description and repro for the issue.
I don’t think there is any need to teleport the players individually, I’m relatively certain this could not cause any issues.
Can you post a screenshot of what it looks like for the player? Is it obvious that they have been disconnected to the game? Does their connection to the server drop off but everything else looks normal?
It’s extremely difficult for me to reproduce because I think it’s linked to PC/internet speed, both of which run excellent for me. It’s happened to me before but this is my 5th try and I can get it to break again… hmm
I’ve just done some testing and it looks like OnTeleport isn’t firing on the server for FilteringEnabled games (at least for any state other than RequestedFromServer). Maybe you can actually handle the error using this event on the client.
Those are CoreGui scripts. They are written by roblox, not me. That being said, they fail whenever the TeleportToPrivateServer API fails. Player1 is teleported from Server1 to Server2.
When the request fails it looks like this:
-Server1 sends Player1 to Server2 using TeleportToPrivateServer
-Player1’s screen shows he’s still in Server1
-Server2’s Players instance has Player1 loaded in it for 2 seconds until it’s removed
-CoreGui in Server2 fails
-Server1 still holds Player1