Garry's Mod Wiki

Entity:FireBullets

  Entity:FireBullets( table bulletInfo, boolean suppressHostEvents = false )

Description

Fires a bullet.

When used in a hook such as WEAPON:Think or WEAPON:PrimaryAttack, it will use Player:LagCompensation internally.

Lag compensation will not work if this function is called in a timer, regardless if the timer was made in a predicted hook.

Due to how Entity:FireBullets is set up internally, bullet tracers will always originate from attachment 1. This can be avoided by supplying your own tracer effect.

When firing bullets from a Weapon, it is recommended to fire bullets from the weapon owner entity (Player or NPC), not the Weapon itself.

Arguments

1 table with Bullet structure bulletInfo
The bullet data to be used. See the Bullet structure.
2 boolean suppressHostEvents = false
Has the effect of encasing the FireBullets call in SuppressHostEvents, only works in multiplayer.