Tell if a Player Failed to Teleport?

In my game I want to teleport five players to their private server which would run the main game, however I need to know if one player fails to teleport or closes out of the game so I can cancel that match and send them back to the lobby. How can I find out if someone fails/closes the teleport? Is this possible or should I just give each player ~45 seconds to get in otherwise the match is cancelled?

2 Likes

The only solution i can really think of is doing it in a pcall function.

local succ,err = pcall(function() 
-- Teleport player here
end)
If err then
--then it errored
end
3 Likes

There are two events that you can use:

3 Likes

When you kick someone while they are teleporting, they’ll have the “You’ve been kicked” screen. However, the game STILL attempts to teleport them, and they CAN be teleported.

Also, it’s possible for like the game not teleporting the player for a minute, but doesn’t have an error.

The things suggested are helpful, but I’m still not sure how to tell the game server that the player failed to teleport. That’s what I need so it knows that this match should be cancelled.

You can use the new MessagingService to tell the private server that a player failed to teleport.
You can also make like 30 seconds intermission before the round starts in the private server, so that everyone has time to get teleported, and the server to receive the message.

6 Likes

Thank you so much! I had no idea about the MessagingServer thing!