for i, v in pairs(game.Players:GetChildren()) do if v:IsA("Player").TeamColor==BrickColor.new("Really red") then v.Character.Humanoid.Health=0 end end It says this :
19:06:45.138 - Workspace.Script:11: attempt to index a boolean value
I think it's "Really Red" Other than that, I don't know,
I really need help, if anyone found any solution please send.
Please use a code block in the future. It helps us read your code properly
for i, v in pairs(game.Players:GetChildren()) do if v:IsA("Player").TeamColor==BrickColor.new("Really red") then v.Character.Humanoid.Health=0 end end
Let me re-write line 2 as lua would understand it
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:
for i, v in pairs(game.Players:GetPlayers()) do if v.TeamColor==BrickColor.new("Really red") then v.Character.Humanoid.Health=0 end end