Hello! I need to make a server matchmaking system for my game but I'm not that good at scripting so I don't know how to do it. Can someone help me?
This can probably help:
if #myTableName > 1 then local playerIndex = math.Random[1,#myTableName] local nextplayerIndex = math.Random[1,#myTableName] repeat if nextplayerIndex == playerIndex then nextplayerIndex = math.Random[1,#myTableName] end until nextplayerIndex ~= playerIndex local player1 = game.Players[myTableName[playerIndex]] local player2 = game.Players[myTableName[nextplayerIndex]] -- Proceed to teleport players. end