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