|
| 23 Apr 2017 01:13 PM |
also the team has to be balanced
shadilay |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Apr 2017 01:19 PM |
teamcolors = {'Really red','Really black'}
for _,v in pairs(game.Players:GetPlayers()) do v.TeamColor = teamcolors[math.random(1,#teamcolors)] end |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2017 01:20 PM |
| im not sure if you change teamcolors w brickcolor btw so if that's the case just put BrickColor.new() around it |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2017 01:24 PM |
Those scripts above aren't balanced...
local teams=game:GetService('Teams') local red=teams:WaitForChild('Red') local blue=teams:WaitForChild('Blue')
local list={blue,red}
game:GetService('Players').PlayerAdded:connect(function(player)
if #red:GetPlayers()>#blue:GetPlayers()then player.TeamColor=blue.TeamColor elseif #red:GetPlayers()<#blue:GetPlayers()then player.TeamColor=red.TeamColor else player.TeamColor=list[math.random(1,#list)] end
end) |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2017 02:46 PM |
| didn't realize he said balanced mb |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2017 10:03 PM |
im making a minigames script and for some reason its not working
local rt = Instance.new("Team",game.Teams) local bt = Instance.new("Team",game.Teams) rt.Name = "Red" rt.TeamColor = BrickColor.new("Really red") bt.Name = "Blue" bt.TeamColor = BrickColor.new("Really blue") wait() local teams=game:GetService('Teams') local red=teams:WaitForChild('Red') local blue=teams:WaitForChild('Blue')
local list={blue,red}
for i,player in pairs (game.Players:GetChildren()) do if #red:GetPlayers()>#blue:GetPlayers()then player.TeamColor=blue.TeamColor elseif #red:GetPlayers()<#blue:GetPlayers()then player.TeamColor=red.TeamColor else player.TeamColor=list[math.random(1,#list)] end end
shadilay |
|
|
| Report Abuse |
|
|
Dratik
|
  |
| Joined: 13 Nov 2008 |
| Total Posts: 36385 |
|
| |
|
|
| 23 Apr 2017 10:17 PM |
something about getting a brickcolor and expecting an object i believe
shadilay |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2017 10:24 PM |
local function randomizeTeams(...) local players, teams = game.Players:GetPlayers(), {...} for x = 1, (#players), 1 do local y = math.random(1, (#players)) players[x], players[y] = players[y], players[x] end for x = 1, (#players), 1 do players[x].TeamColor = BrickColor.new(teams[(x % (#teams)) + 1]) end return (nil); end
randomizeTeams("Bright blue", "Bright red", "Bright green") |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2017 10:30 PM |
only one person was capable enough to use modulus and make it easy
|
|
|
| Report Abuse |
|
|
|
| 24 Apr 2017 03:11 PM |
its not assigning me to a team, im just neutral
shadilay |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2017 05:43 PM |
| Mine? I don't see how, but I can't test it right now when I tested first I did it with 8 players |
|
|
| Report Abuse |
|
|