# Create Inventory Item

Grammar — Create one itemType item in the inventory of u
FlagsNative | Action

Creaters an item in a unit’s inventory. Use the “Last Created Inventory Item” function to refer to the created item.

# Arguments

  • unit — Unit
  • string [ gamelink::Unit ] — Item Type

Returns — void

native unit UnitInventoryCreate(
	unit inUnit,
	string itemType,
);

Category: Unit / Items

# Examples

# mods/warcoop/warclassicsystem.sc2mod

WarClassicSystem.galaxy

// L471
UnitInventoryCreate(lv_target, UnitGetType(lv_item))
// L1441
UnitInventoryCreate(lv_caster, lv_itemType)

# mods/warcoop/warcoopdata.sc2mod

WarCoopData.galaxy

// L1759
UnitInventoryCreate(lp_hero, lv_item)

# mods/warcoop/warmeleeai.sc2mod

Orc.galaxy

// L646
UnitInventoryCreate(u,c_IT_PotionofHealingAI)
// L647
UnitInventoryCreate(u,c_IT_PotionofManaAI)
// L648
UnitInventoryCreate(u,c_IT_ScrollofRegenerationAI)
// L649
UnitInventoryCreate(u,c_IT_ScrollofTownPortalAI)