Just wondering how would i be able to get all accessories on npcs and players and add them to a ignore list?
Hi!
So, why not just put the whole NPC character or Player Character on the Blacklist instead? 
Otherwise just do:
for _, Child in pairs(Character:GetChildren()) do
if Child:IsA("Accessory") then
--Add to blacklist
end
end
not trying to blacklist the entire npc because i need to kill the npcs, and for the players there will be specific pvp zones
Then do as I did above, and check for all accessories in a character. 
And add/remove it from blacklist to your liking.
how would i make it go through like a folder of npcs?
Well…
´´´lua
local NPCFolder = …
for _, Character in pairs(NPCFolder:GetChildren()) do
if Character:IsA(“Model”) and Character:FindFirstChildWhichIsA(“Humanoid”) then
–Loop here
end
end
(edit)
changed the code and got it to print the accesory but im pretty sure it doesnt add it to the table or something?
for i, v in pairs(NPCFolder:GetChildren()) do
if v:IsA("Model") and v:FindFirstChildWhichIsA("Humanoid") then
for _, v2 in pairs(v:GetChildren()) do
if v2:IsA("Accessory") then
table.insert(CastP.FilterDescendantsInstances, v2)
end
end
end
end
boosting for a answer to this (char limit)
Hi!
Are you sure about that the accessories will be detected by the raycast in the first place? 
im pretty sure it does, i printed the hit and it hits the accessory’s handle
You could do something simple like
for _, Object in pairs(Character:GetDescendants()) do
if Object:IsA("BasePart") and Object.Parent:IsA("Accessory") then
--Put object in Blacklist
end
end
Done. 
Edit: Or take my first sample, where we’re only looking for accessories inside the Character. If you blacklist a accessory, then it will include all the descendants that the accessory might include, which is what you aim for. 
ill try this but just wondering
table.insert(CastP.FilterDescendantsInstances, v2:FindFirstChild("Handle"))
wouldn’t this work? or is there something im missing
also does it matter if im running the function when the tool gets equipped?
Test out your script, make prints, even try to print the table that you’re trying to blacklist. Try and troubleshoot it.
local function onEquipped()
CastP.FilterDescendantsInstances = {tool.Parent, BFolder}
local NPCFolder = game.Workspace.Mobs
for i, v in pairs(NPCFolder:GetChildren()) do
if v:IsA("Model") and v:FindFirstChildWhichIsA("Humanoid") then
for _, v2 in pairs(v:GetChildren()) do
if v2:IsA("Accessory") then
print(v2)
print(v2:FindFirstChild("Handle"))
print(CastP.FilterDescendantsInstances)
table.insert(CastP.FilterDescendantsInstances, v2)
table.insert(CastP.FilterDescendantsInstances, v2:FindFirstChild("Handle"))
print(CastP.FilterDescendantsInstances)
end
end
end
end
end
it prints the accessory and its handle, im just not sure why its not being added to the table
and for the table it prints before and after with no change to it whatsoever


local FilterTable = {}
for i, v in pairs(NPCFolder:GetChildren()) do
if v:IsA("Model") and v:FindFirstChildWhichIsA("Humanoid") then
for _, v2 in pairs(v:GetChildren()) do
if v2:IsA("Accessory") then
table.insert(FilterTable, v2)
end
end
end
end
CastP.FilterDescendantsInstances = FilterTable
Uncertain if this works, try it 
this did work, ty! (character limit)
Np! Feel free to return if you got any further questions!