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
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,
It's Really red, the only problem is the bolean thing.
Are you sure it's referencing that script? It could be talking about something else that is causing this script to fail
the 2and word in all BrickColors is always uncapitalized
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
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Dude, I can clearly tell that you aren't showing your full code