Garry's Mod Wiki

Revision Difference

Entity:FireBullets#566229

<function name="FireBullets" parent="Entity" type="classfunc"> <description> Fires a bullet. When used in a hook such as <page>WEAPON:Think</page> or <page>WEAPON:PrimaryAttack</page>, it will use <page>Player:LagCompensation</page> 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. Due to how `Entity:FireBullets` is set up internally, bullet tracers will always originate from the first attachment/index 1. This can be avoided by supplying your own tracer effect. When firing bullets from a <page>Weapon</page>, it is recommended to fire bullets from the weapon owner entity (<page>Player</page> or <page>NPC</page>), not the <page>Weapon</page> itself. </description> <realm>Shared</realm> <args> <arg name="bulletInfo" type="table{Bullet}">The bullet data to be used. See the <page>Structures/Bullet</page>.</arg> <arg name="suppressHostEvents" type="boolean" default="false">Has the effect of encasing the FireBullets call in <page>Global.SuppressHostEvents</page>, only works in multiplayer.</arg> </args> </function>