Team divide doesn't work, all players are put on one team when countdown begins?
Asked by
8 years ago Edited 8 years ago
01 | maps = game.Lighting.Maps:GetChildren() |
02 | h = Instance.new( "Hint" , game.Workspace) |
03 | player = game.Players.LocalPlayer |
06 | if game.Players.NumPlayers > 1 then |
07 | h.Text = "Deciding What Map To Play" |
09 | ranGame = math.random( 1 , #maps) |
10 | mapChosen = maps [ ranGame ] |
11 | h.Text = "Map Chosen: " .. mapChosen.Name |
13 | mapChosenClone = mapChosen:clone() |
14 | mapChosenClone.Parent = game.Workspace |
17 | local players = game.Players:GetPlayers() |
18 | for i = 1 , #players do |
19 | local player = players [ i ] |
21 | player.TeamColor = BrickColor.new( "Black" ) |
22 | else player.TeamColor = BrickColor.new( "White" ) |
27 | for i,v in pairs (game.Players:GetPlayers()) do |
28 | if v.Character ~ = nil then |
29 | if v.Character.Humanoid ~ = 0 then |
30 | v.Character.Humanoid.Health = 0 |
37 | h.Text = "Time left: " .. i |
48 | for i,v in pairs (game.Players:GetPlayers()) do |
49 | if v.Character ~ = nil then |
50 | if v.Character.Humanoid ~ = 0 then |
51 | v.Character.Humanoid.Health = 0 |
57 | local players = game.Players:GetPlayers() |
59 | local player = players [ i ] |
60 | player.TeamColor = BrickColor.new( "Medium stone grey" ) |
63 | mapChosenClone:Destroy() |
65 | h.Text = "There needs to be more than 1 player to start" |
Issue: All players are put on one team
Help would be appreciated!