Sorry for reposting another question, how would I go upon selecting two random players from a table? I'd find that for my game, it'd be more efficient than choosing two players from a team, since I'd only be changing their teams from one to another. (Might not make sense, but just know I'd be using a lot of teams if I did the other method)
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")
local PlayingTable = {}
for i, v in pairs(game.Players:GetPlayers()) do
if v.Character then
table.insert(PlayingTable, v.Name)
local Players = game.Players:GetPlayers()
local Chosen1 = PlayingTable[math.random(1, #PlayingTable)]
local Chosen2 = PlayingTable[math.random(1, #PlayingTable)]
repeat Chosen2 = PlayingTable[math.random(1, #PlayingTable)] until Chosen2 ~= Chosen1 --I'm getting a Gamescript timeout here
print(Chosen1)
print(Chosen2)
end
end
Thanks,
LukeGabrieI
