How Do I Teleport A Player To A Server That Does Not Have A Round In Progress?

  1. What do you want to achieve? Keep it simple and clear!

    I want to add a button in my “Bomb Pass” style game that teleports you to another server that doesn’t have a round in progress

  2. What is the issue? Include screenshots / videos if possible!

I have no idea how to check if a server has a round in progress or not; is there a way to loop through servers to see which one has a open slot?

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I could not think of any solution, but I am imagining there is a way to attach data to a server, such as a “gameStartingSoon” bool which will allow me to weed out a good server easily.

I have seen a few games that do this before, but I have no idea how to pull it off : L
FOR EXAMPLE: Doom spire Brickbattle

The “Play Again” button at the top teleports you to a different server, but to be fair, in doomspire, you can join any server and be put in a match

1 Like

#help-and-feedback:scripting-support

So there is actually 2 things you could use.

1 is unoptimized and 2 is optimized

  1. Use the .LocalPlayerArrivedFromTeleport event on the client and fire a RemoteEvent to the server. On the server, have a variable (boolean) that has information about the game currently running. Check if that boolean is true, if it is, send the player to another server until it finds one. Unoptimized because it could take the player ages.

  2. I recommend this way if you are familiar with it. Use MemoryStoreService. I am really unfamiliar with MemoryStoreService but you can get a SortedMap and then when in a server the game ended/started it will update it’s SortedMap accordingly. You must store information about the JobId there. You get the information with :GetAsync() and look if the game is not running. If it isn’t you teleport the player to that server. Use TeleportAsync and a TeleportOption and set the ServerInstanceId to the server you want to teleport. Only requires one teleport and is much faster.

This Can Potentially Be The Solution (option 2). I’ll do some research and I’ll let you know what I find!
Thank you!

1 Like

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