Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Killing all players in that one team script doesn't work?

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

1 comment

0

Dude, I can clearly tell that you aren't showing your full code

3 answers

I think it's "Really Red" Other than that, I don't know,

3 comments

0

It's Really red, the only problem is the bolean thing.

0

Are you sure it's referencing that script? It could be talking about something else that is causing this script to fail

0

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.