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
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?
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
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.
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.