Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a working server matchmaking system?

Asked by 3 years ago

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?

0
Do you have your own idea of what you want to do? It's reasonable to have bad scripting skills but you dont have your own idea... Xapelize 2658 — 3y
0
Yes. I'm not a scripting beginner. I know the basics of ROBLOX scripting, but I don't know so much further. My idea is to make a server matchmaking system like Elimination Tower, Eviction Notice or Outlaster. BrasileiroConstrutor 27 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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
Ad

Answer this question