Answered by
7 years ago Edited 7 years ago
Please use a code block in the future. It helps us read your code properly
1 | for i, v in pairs (game.Players:GetChildren()) do |
2 | if v:IsA( "Player" ).TeamColor = = BrickColor.new( "Really red" ) then |
3 | v.Character.Humanoid.Health = 0 |
Let me re-write line 2 as lua would understand it
1 | if true .TeamColor = = BrickColor.new( "Really red" ) then |
See a problem there? v.IsA("Player")
is converted to true and then the next part is analyzed.
This check is useless anyways unless you are adding stuff to game.Players
, something you should not do. If you really need to add stuff in there for some reason, use this code:
1 | for i, v in pairs (game.Players:GetPlayers()) do |
2 | if v.TeamColor = = BrickColor.new( "Really red" ) then |
3 | v.Character.Humanoid.Health = 0 |