Basically I have a team where everybody starts as, and 2 players that are randomly selected from this team will play a game and this'll happen until there's nobody in the team that everybody started at.
local teams = game:GetService("Teams")
local matchmaking = teams:WaitForChild("Matchmaking")
local round1 = matchmaking:WaitForChild("Round 1")
local round2 = matchmaking:WaitForChild("Round 2")
local round3 = matchmaking:WaitForChild("Round 3")
wait(10)
for i, v in pairs(game.Players:GetPlayers()) do
if v.Team == game.Teams["Not Playing"] then
local noteam = game.Teams["Not Playing"]
local chooseplayers = noteam:GetPlayers() -- I don't know if this is correct
local Chosen1, Chosen2 = math.random(1, #chooseplayers)
repeat Chosen2 = math.random(1, #chooseplayers) until Chosen2 ~= Chosen1
print(chooseplayers[Chosen1].Name)
print(chooseplayers[Chosen2].Name)
end
end
Thanks,
LukeGabrieI

1 comment
I was wondering how would I do it if I placed Players' Names into a Table, and tried selecting two random players inside a table? How would I go upon doing that?