Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I split players from a table into teams?

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

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...

This discussion is preserved as it was. New answers, comments, and votes are closed.