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

Help please, this function wont work.. Anyone?

Asked by
Irvene 5
9 years ago

This function isn't runing properly, nor does it run at all.. I need help! Someone tell me what's wrong

NOTE: It's supposed to team both players on bright blue, and red evenly when the game starts..

function teams()
local balanceTeams = function(players, teams, randomize, callback)
for key = 1, #players do
local value = table.remove(players, randomize and math.random(#players) or 1);
if (not callback) or callback(key, value) then
value.TeamColor = teams[(key % (#teams + 1)) + 1];


balanceTeams()
players:GetPlayers() -- List of all players
{BrickColor.new("Bright red"), BrickColor.new("Bright blue")} -- List of all teams
end
end
end

Answer this question