Soldier.addNewItem 36

Adds an item to the soldier's inventory


Return value

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

Parameters

ParameterTypeDescription
1stringThe id of the item to add
2bool(Optional) Should the soldier wear the clothing / equip the weapon item. Default is false

Examples

Example 119

local soldier = er2.getPlayer()
soldier.addNewItem("jap_infantry_helmet_4_net", true) -- Adds to the player a japanese helmet and force equips it

Equip item to soldier

local soldier = er2.getPlayer()
soldier.addNewItem("m60", true) -- Adds an M60 to the player and force equips it

Back to Scripting API