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

How would I split players from a table into teams?

Asked by 10 years ago

Okay, so if I have all the player's names split into two separate teams, how would I access them to split the players that are inside each of the tables to their teams?

1 answer

Log in to vote
-1
Answered by 10 years ago
local team1 = {}
local team2 = {}

for key,value in ipairs(team1) do
    if game.Players:FindFirstChild(value) == nil then return end
    game.Players:FindFirstChild(value).TeamColor = game.Teams.Team1.TeamColor
end

for key,value in ipairs(team2) do
    if game.Players:FindFirstChild(value) == nil then return end
    game.Players:FindFirstChild(value).TeamColor = game.Teams.Team2.TeamColor
end

This should work I believe...

Ad

Answer this question