NPCs Ignore Certain Team

Is there a way to make it so NPC’s will ignore players on a certain team?

Thanks in advance,

What type of NPC?

More info please.

You can always use ply:Team() == in the NPC use or attack function.

Its a zombie npc? The type created as an entity.

Overwrite player:SetTeam() so that it calls a hook and set all NPCs of that class to love the player whenever the hook is called. Or if you want all NPCs of all classes to ignore them, you could always do player:SetNoTarget(true), which is how I did it for my old zombies gamemode.

ent:SetNoTarget makes ALL NPC’s ignore you.

You should, use ent:Fire to add a relation ship so you can control, which npc’s are friends and which not (What i am assuming, you want to do).

Thats what I said, except with SetEntityRelationship…