I have a line of code here that fires off a ray along with a Blacklist. However, the ray does not ignore hats. Whenever a player shoots a player's hat, the ray stops at the hats and the player takes no damage as if he were wearing a shield.
Caster:FireWithBlacklist(FirePointObject.WorldPosition, Direction * Module.Range, Module.BulletSpeed, {Handle, Tool.Parent, game.Workspace:FindFirstChild("Ignore")}, Bullet)
I have done quite some extensive research on this in hopes to be able to fix it. However, I have come up empty handed every time. I normally get errors like:
Unable to cast value to Object
or some other ones that I forget.
At some point, I tried to do:
Caster:FireWithBlacklist(FirePointObject.WorldPosition, Direction * Module.Range, Module.BulletSpeed, {Handle, Tool.Parent, game.Workspace:FindFirstChild("Accoutrement") game.Workspace:FindFirstChild("Ignore")}, Bullet)
But then that would make the ray go through all of the character parts not just the hats and it does not do damage.
How would I fix this to where the ray is able to hit the character's head, even if the character is wearing a mask or so?

3 comments
I'm not sure I follow what the "i" is supposed to stand for in targetHats[i] = child. I apologize
That's my mistake - should have proofread the answer before posting. Changed it now - sorry!
Hm, it seems my main problem now is somehow making 'targetCharacter' all of the Player Character's in Workspace whilst this is in a Script not a LocalScript.