LuaDocs/HDFirearm
From Data Realms Wiki
Contents |
Parent: HeldDevice
Concrete Class. A firearm device that fires projectile MO's and discharges shell MO's.
Properties
ClassName
The class name of this Entity.A string with the friendly-formatted type name of this object.
RateOfFire
The rate of fire of this. 0 means it is semi auto. (ie only one discharge per activation).The rate of fire, in rounds per min. If 0, firearm is semi-automatic.
RoundInMagCount
Read-only property. The number of rounds still in the loaded magazine. Negative value means infinite ammo.An int with the number of rounds in the magazine currently in this HDFirearm. Negative means infinite ammo.
Magazine
Read-only property. The currently attached Magazine, if any.The Magazine, if any is attached.
Functions
SetNextMagazineName
Sets the Preset name of the next Magazine that will be loaded into this gun. This changes all future mags that will be reloaded.
Arguments:
- The preset name of the new Magazine to load into this from now on.
Return value:
Whether the specified magazine was found and successfully prepared.