How Would I Make a Server-Locked Matchmaking System?

Hello everyone! I would like to know how to make a matchmaking system that is locked to just the server (A non-global matchmaking system). I looked at many tutorials but could not seem to find one that would work and fit my needs!


Also, if a player wins that round, how would I increase the players wins/coins if they didn’t teleport back to the start place? Assuming I have a leaderstat folder with an integer value labeled, “Coins”! Thank you all for your help!

For the matchmaking system, all you can do is let players join a specific server; afterward, it really depends on how you want the player to signal that they are ready.

For example, if it’s through any TextButton, you could use Remote Events to send a signal to the server indicating that the player is ready.

Now, what should the server handle? It’s quite simple; you can create a table:
local Queue = {}

Upon having that queue, you want the server to listen for any remote events coming from that player’s text button event. Something like:

local Queue = {}

Remote.OnServerEvent:Connect(function(player)
    if not table.find(Queue, player) then -- Check for duplicates
       table.insert(Queue, player)
    end
end)
-- You will also need to account for situation where player disconnects to remove them etc................

And now, with that, the Queue table will be filled with players that are ready to play, and you can teleport them using TeleportService, and then clear the table and fill them with players again! :smiley:


For the data-saving part, just don’t teleport players between two games, but teleport them between two places of one experience and save it inside the game. By default,

DataStores do transfer between any place within the same experience.

1 Like

I know that you can’t write whole scripts for me, but would you sort of guide be how to check if a player disconnects? I already have it if a player wants to leave queue.
Thanks!

game.Players.PlayerRemoving:Connect(function(player)
  -- Player disconnects, remove it through table.remove()))
end)
1 Like

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