I need this script so that once the hunter is chosen the player is assigned to the team called Hunter and others who are not the hunter are assigned to the team called Props.
wait(6) while true do h = Instance.new ("Message") p = game.Players:GetChildren() randplayer = p[math.random(#p)] --Chooses the random Laser King randplayer.TeamColor = BrickColor.new("Toothpaste") randplayer.Character:BreakJoints() m = Instance.new("Hint") m.Parent = workspace m.Text = randplayer.Name.." is the Hunter " wait(3) m.Text = randplayer.Name.." Your goal is to kill all of the Props good luck! " wait(3) m.Parent = nil h.Parent = workspace h.Text = "Props! You have 2 minutes to hide and survive the hunter! " wait (5) h.Parent = nil hm = randplayer.Character.Humanoid hm.MaxHealth=300 --Chooses their max health hm.Health=300 --Chooses their current health wait(120) --This is where you change the leangth of the game for i = 1,#p do if p[i].TeamColor == BrickColor.new("Red") then p[i].TeamColor = BrickColor.new("Red") end end h.Parent = workspace h.Text = "End of round!" wait(4) h.Text = "Get ready for the next round!" wait (4) h.Parent = nil end
Explain your problem.. I don't see anything bad. You're doing it just fine, but, @25,26
if p[i].TeamColor == BrickColor.new("Red") then p[i].TeamColor = BrickColor.new("Red") --Wait what??