Soldier.addAmmo 80

Adds an ammo box to the soldier's invetory


Return value

Return TypeDescription
boolReturns true if the ammo box has been added to the soldier's inventory successfully

Parameters

ParameterTypeDescription
1stringThe id of the ammo box
2integer(Optional) The number of bullets to put in the box (Default is 0). NOTE: You can set the box capacity to any value. To add boxes with ammo set at their default full capacity there are different functions.

Examples

Example 123

local player = er2.getPlayer()
player.addAmmo("ammo_30_06", 500) -- Adds a box of 500 30.06 bullets to the player's inventory

Back to Scripting API