Matchmaking system using only Memory stores and TeleportService

I wanted to make a system that would prevent players from joining a game if the game was in progress so I made a matchmaking system with the new Memory stores.

It basically works by checking if there are any servers that are not in progress / need players by checking a sortedMap using RangeAsync. If there are no servers then it just teleports the player to a brand new server, when a new server starts up it adds itself to the SortedMap, once it reaches enough players/begins it removes itself from the sortedMap. It also removes itself from the sorted map when the server closes using BindToClose.

Hope you found it pretty neat.

6 Likes