How to script a SWEP for NPC

Tried to do it with functions SWEP:NPCPrimary_Attack() and other stuff, but I still can’t figure out how to make them actually shoot, because now they just play the attack animation. Anyone knows how to do this?

SWEP:NPCPrimary_Attack is a callback function that should be called when NPC tries to shoot.

So the function I should be using is SWEP:PrimaryAttack?

I never said that.

Then the function I need to use for NPC to shoot is SWEP:NPCPrimary_Attack ?

I don’t think you can force NPC to shoot, but SWEP:NPCPrimary_Attack should be called ( not saying will be because I haven’t messed around with this for a long time ) on the SWEP the NPC is currently carrying, just like SWEP:PrimaryAttack is called when a player tries to shoot.

I also wasn’t able to alter rate of fire or accuracy of the weapon for NPCs.