Garry's Mod Wiki

Garry's Mod Wiki

  game.AddAmmoType( table ammoData )

Description

Adds a new ammo type to the game.

You can find a list of default ammo types here.

This function must be called on both the client and server in GM:Initialize or you will have unexpected problems.
There is a limit of 256 ammo types, including the default ones.

Arguments

1 table with AmmoData structure ammoData
The attributes of the ammo. See the AmmoData structure.

Example

Add an ammo type.

game.AddAmmoType( { name = "BULLET_PLAYER_556MM", -- Note that whenever picked up, the localization string will be '#BULLET_PLAYER_556MM_ammo' dmgtype = DMG_BULLET, tracer = TRACER_LINE, plydmg = 0, -- This can either be a number or a ConVar name. npcdmg = 0, -- Ditto. force = 2000, maxcarry = 120, -- Ditto. minsplash = 10, maxsplash = 5 } )

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...