Difference between revisions of "LUA:AddItem"
(Created page with "{{LUAFunction |Name = AddItem |Description = Is for adding a single item or stack of items. |Param1 = Spawn |Param1Desc = is the spawn to add the item to |Param2 = int32 |Para...") |
(No difference)
|
Latest revision as of 13:36, 11 February 2021
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