Garry's Mod Wiki

Bullet

Description

Tables used for bullets see Entity:FireBullets and GM:EntityFireBullets.

Members

Entity Attacker
The entity that should be reported as attacker eg. a player

By default this would be set to the entity Entity:FireBullets is called on.

Default: self

function Callback
Function to be called after the bullet was fired but before the damage is applied (the callback is called even if no damage is applied). The arguments are:

The return value can be a table with following keys:

  • boolean effects - false to not do any of the effects.
  • boolean damage - false to not do any damage.

Default: nil

number Damage
The damage dealt by the bullet.

If set to 0, it means the damage should be calculated from the ammo type's ConVars if the ammo type has AMMO_INTERPRET_PLRDAMAGE_AS_DAMAGE_TO_PLAYER flag set.
See AmmoData structure.

Default: 1

number Force
The force of the bullets

Default: 1

number Distance
Maximum distance the bullet can travel

Default: 56756

number HullSize
The hull size of the bullet

Default: 0

number Num
The amount of bullets to fire

Default: 1

number Tracer
Show tracer for every x bullets

Default: 1

string AmmoType
The ammunition name

Default: "<empty string>"

string TracerName
The tracer name. You can find a list of default effects here.

Default: "nil"

Vector Dir
The fire direction

Default: Vector( 0, 0, 0 )

Vector Spread
The spread, only x and y are needed

Default: Vector( 0, 0, 0 )

Vector Src
The position to fire the bullets from

Default: Vector( 0, 0, 0 )

Entity IgnoreEntity
The entity that the bullet will ignore when it will be shot.

Default: NULL