Matchmaking, best way?

What’s the best way to make a match making type of script, I’ve done it before but I want to know what the best way is.

2 Likes

I think this will help you. No idea if its the “best” way but I assume it is a good way

1 Like

A good way is to add the players’ names who want to be sent to a match into a table, then once the intermission is over for loop the table and teleport them.
You can achieve that by using TeleportService’s :ReserveServer() and :TeleportToPrivateServer()

Helpful links:

1 Like

There is no answer to this question. Matchmaking is dependent on the type of game you’re running and what you require for such matchmaking. There is no best way because truthfully, you can do it any number of ways and it’ll be the best for your game but terrible for another.

It’d be helpful to provide specific details about your game’s flow to do this. Are you creating an MMO? PvE survival? 1v1 PvP? TDM? Provide details!

On the other hand, as far as matchmaking in general goes, your flow is essentially collecting the player’s in a queue for a round based on specific criteria and sending them to a reserved server of the game place.

3 Likes

Match making for 1v1 PvP, and TDM, I am highly interested on how I could get this to work!

To do this you’ll need to add players and remove them from tables when they join/leave, and when each match is over.

local participants = {} -- the players in the match (remove every round and readd)

local selectedplayer1 selectedplayer1 = participants[math.random(1,#participants)] -- finds a random player to fight
local selectedplayer2
repeat wait()
selectedplayer2 = participants[math.random(1,#participants)] until selectedplayer2 ~= selectedplayer1 -- making sure this player isn't the previous one

if selectedplayer1 and selectedplayer2 then -- making sure the players are still in the game.
print(selectedplayer1.Name.."VS"..selectedplayer2.Name)
end```
3 Likes