Sent a reply through dm cause I didn’t want to bump topic unnecessarily too many times but here is a solution.
local PlayingTable = {}
local placeid = 0
local TeleportService = game:GetService('TeleportService')
local randomplrs = PlayingTable[math.random(#2, PlayingTable)]
if randomplrs then
TeleportService:Teleport(placeid, randomplrs)
end
local TPS = game:GetService("TeleportService")
local MatchTable = {} -- Table for your players
local function Matchmake()
local rand1 = math.random(1, #MatchTable)
local player1 = MatchTable[rand1]
table.remove(MatchTable, rand1)
local rand2 = math.random(1, #MatchTable)
local player2 = MatchTable[rand2]
table.remove(MatchTable, rand2)
local serverCode = TPS:ReserveServer(game.PlaceId)
TPS:TeleportToPrivateServer(game.PlaceId, serverCode, {player1, player2})
end
Something I was able to quickly make. You will probably want to change game.PlaceId to a place that is made for matches, but this is just a demonstration.