ReservedServers not working occasionally

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.

You should use this function:

See also:

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.

1 Like

This is a bug.

The players coregui flickers for a second and they’re no longer part of the server. .OnTeleport and TeleportState don’t mean a thing if the player is already gone.

You should add that to the OP in that case (or even a more detailed description / screenshots), because I read your entire post and that wasn’t clear to me.

Players begin to teleport but don’t actually go anywhere.

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?

Can they view the local console?

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

You could try to get some statistics about the percentage of teleports that actually fail without failing gracefully in the OnTeleport event.

This can be achieved by logging the number of teleports initiated against the number of successful teleports with the LocalPlayerArrivedFromTeleport event.

That’s also broken.

.OnTeleport errors when I run it and it returns one thing: Teleport requested by server. Nothing else.

This is the only thing in the output:
blob.png

My code:

blob.png

Are you using it on the client or the server?

It will only show you RequestedFromServer on the server as the other states all occur on the client and are not replicated. Not sure what is up with the error at line 117 though.

Everything is from the server. 117 is the PlayerT.OnTeleport line

Got it to break!

I can see the player list in-game but the ServerLog is clear (no text). The PlayerLog (errors) is still there, (with text)

Also something: It’s group-only.

Maybe the group API is updating slow or something?

ALSO: The player who fails to teleport shows up on the in-game playerlist (pictures above^) but on the failed teleport players screen they aren’t in-game.

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.

That’s not the biggest issue. The biggest issue is TeleportToReservedServer. D:

max is doing a game review right now and he joined my match in progress. His name popped up on the playerlist for 1-2 seconds but on his screen he’s still stuck in teleport.

Can you please look into what’s up with TeleportToReservedServer?

EDIT: Unrelated (?), but we also got this error: blob.png

PS:

Player is teleporting from Place1 to Place2. They get stuck in Place1 but Place2 sees this in the output.

Are any admins working on this? Could you please let me know? My game depends quite heavily on this working flawlessly.

This means that there is no property/child of an ImageLabel instance called “Icon”. Perhaps you meant “Image” instead?

I don’t think you understand.

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

@TheGamer101

Whoops. Didn’t even check. Sorry about that. :stuck_out_tongue: