Garry's Mod Wiki

WEAPON:NPCShoot_Primary

  WEAPON:NPCShoot_Primary( Vector shootPos = GetShootPos(), Vector shootDir = GetAimVector() )

Description

Called internally during TASK_RANGE_ATTACK1. This allows you to separate your SWEPs primary firing function from players and NPCs.

This hook is called internally only for NPCs that has CAP_USE_SHOT_REGULATOR set.

Arguments

1 Vector shootPos = GetShootPos()
The world position the NPC will use as attack starting position. You can create your projectiles here.
2 Vector shootDir = GetAimVector()
The direction the NPC wants to shoot at.