No categories assigned

LUA:AddItem


LUA:AllFunctions - AddItem

Return to: LUA:AllFunctions | Tutorials | Portal | Forum | Project Manager | Bug Tracker


Is for adding a single item or stack of items.

Syntax

AddItem(param1, param2, [opt param1])

Parameters

Required - param1 (Spawn), param2 (int32)
param1 is the spawn to add the item to
param2 is the item id
Optional - opt param1 (int16)
opt param1 is the quantity to be added

Example

function hailed(NPC, Spawn)
	AddItem(Spawn, 1234, 5)
end

an NPC with this function will give the player 5 of the item associated with id 1234

Notes

Alternate to SummonItem as it does not allow quantity