How can I detect when teleports don't finish, or fail?

Hi!

I have a game that uses a room-like system, that allows up to 4 players to create a room. The host of this room can kick, and manage players in the room, and also configure the game settings. Once they hit go, they will (ideally) have a private server reserved for them via TeleportService, and all players will be warped to that server.

My issue is detecting failures. When you are teleported to the actual game, it first waits for all players that were in the room to arrive. That way, it has time to set up all their player models, and other data. Then it does terrain generation, and so forth.

But if a player never arrives from the teleport / disconnects during the teleport, the game will infinitely wait for them to arrive. This could easily be solved with a timeout, but I ideally don’t want to use a timeout as balancing a time that isn’t too short for poor connections to reach, and isn’t too long for people to get impatient is annoying.

I may end up having to use a timeout system anyways, but I wanted to know if there was a way to detect when the player fails to finish the teleport. I am thinking of the critical failure point being here, during game joining as they aren’t quite in the game.

If I end up needing a timeout anyways, oh well. I just wanted to make this post to see if there was a way I could detect when the player doesn’t finish the teleport.

I am new to this whole room system concept, so if anyone just has a better approach to this than I do, please let me know!

3 Likes

Bump, I still have not found an answer :<

wrap the teleport method in a pcall , just like this :-

local success , errormessage = nil
success , errormessage = pcall(function()
--put your teleport method only here like TeleportService:Teleport()
end)

success will be set to a boolean determining whatever it succeed or failed , on the other hand errormessage will be set to the error message or nil if it succeed

Will this still return success if it initiates the teleport successfully, but the player doesn’t arrive to their destination?

1 Like

if the player did not arrive to their destination then this is something from roblox it is self that you can not do something about

This is what I was wanting to know. I might just have to issue a timeout. Thanks for your input regardless~!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.