A NPC of mine has a function that ignores targets based on these names. If a model has this name, it will not target it however if it has any other name then it will target it. The problem is that I am not sure how to locate body colors of a model? I have tried these lines, but the NPC breaks and stands still as the code is incorrect:
function findTarget()
for _, p in pairs(workspace:GetChildren()) do
if p:IsA('Model')
and p.Name ~= 'NPCZombie'
and p.Name ~= 'NPCDarkness'
--and p:FindFirstChild('Body Colors').HeadColor ~= 'Really
Black'
--and p:FindFirstChild('Head').BrickColor ~= 'Really Black'
.
--EDIT 1- I have rewritten it as so:
function findTarget()
local BodyColors = Instance.new("BodyColors")
for _, p in pairs(workspace:GetChildren()) do
if p:IsA('Model')
and p.Name ~= 'NPCZombie'
and p.Name ~= 'NPCDarkness'
--and p.BodyColors.HeadColor.Name == 'Really black'
--It still does not work
The rest of the script is not the problem, but how am I supposed to find body colors or brick colors so NPCs with those colors are not targeted?

3 comments
dont make a new line for the and, the and's go into one straight like
can you explain a little better how u want it to work
A player will have the body colors of really black and I want this script to identify it from here.