Hi there, I am looking to make a skill based matchmaking queue. Here are some key points that I want to be implemented into the system.
- When the player presses the queue button it fires an event to the server
- The server enters a player into a dictionary that is accessible across all servers
- The dictionary will contain the player name, rank, and the mode that they queued for
- Once you are in the queue it will then iterate through the dictionary looking for players who queued for the same mode and have similar ranks
- Once it finds a certain amount of players (let's say 4) it enters them into a game.
I've already went ahead and started, here is my local script that handles when the player clicks the button to enter the queue
(Solo and duo are two diffrent buttons)
local function solomatchmaking() matchmaking:FireServer("Solo") end focus.Buttons.Play.Solo.Text.MouseButton1Click:Connect(solomatchmaking) local function duosmatchmaking() matchmaking:FireServer("Duo") end focus.Buttons.Play.Solo.Text.MouseButton1Click:Connect(duosmatchmaking)
And then here is my server sided handler
local matchmaking = game:GetService("ReplicatedStorage").Matchmaking local queuedplayers = { playername = "", playerrank = "", gamemode = "", } function enterqueue(player, mode) if mode == "Solo" then queuedplayers["playername"] = player.Name queuedplayers["playerrank"] = "undefined" queuedplayers["gamemode"] = mode else if mode == "Duos" then queuedplayers["playername"] = player.Name queuedplayers["playerrank"] = "undefined" queuedplayers["gamemode"] = mode end end end matchmaking.OnServerEvent:Connect(enterqueue)
Now obviously this does not replicate across all servers. So players are entering a queue but it's not global, as in accessible by all servers. How do I go about that? Am I on the right track? And once I figure that out, how do I itterate through the table checking for players with similar ranks and ones that are queued for the same mode. I have a mode variable as well that defines what mode they queued for as show on the server script.
Thanks for your time, let me know what you come up with.