Garry's Mod Wiki

Garry's Mod Wiki

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

Description

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

To get the delay the NPC will fire again, you can call self:GetOwner():GetInternalVariable("m_flNextAttack")

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.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...