Ammo System

Ammunition system

The resource provides two different ammunition systems by default:

  1. Configured-ammo system. When the player uses an ammo item, a preset amount of ammunition is added to the weapon. The quantity added is determined in the configuration table config.ammo under the ammo value.

  1. Per-item-as-one-ammo system. Each ammo item counts as one single round. For example, if the player has five ammo items and presses the reload key (R), five rounds are loaded into the weapon. If the number of rounds exceeds the magazine capacity, only enough rounds to fill the magazine are loaded.

How to Change a Weapon’s Ammunition Type

To modify or add ammunition types for weapons, follow these steps:

  1. Open the items/weapon.lua file and locate the weapon you want to edit.

  2. Change the weapon’s ammotype value to the desired type. By default, available types include:

    • AMMO_STUNGUN

    • AMMO_PISTOL

    • AMMO_SMG

    • AMMO_SHOTGUN

    • AMMO_RIFLE

    • AMMO_SNIPER

    • AMMO_MG

  3. To add a custom ammunition type, edit the configAmmo.lua file and extend the config.ammo configuration.

    • The ammoType defined in configAmmo.lua must match the ammoType value specified in weapons.lua.

Last updated