No categories assigned

LUA:RemoveItem

Revision as of 00:08, 14 January 2016 by Jabantiz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA - RemoveItem

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


LUA Functions: RemoveItem()

Removes a single item from the player


Syntax

RemoveItem(param1, param2)


Parameters

Required - param1 (Spawn), param2 (int32)
param1 is the player we want to check
param2 is the item id to remove


Returns

True if an item was removed


Usage

function Deleted(Quest, QuestGiver, Player)
     while HasItem(Player, 5642, 1) do
          RemoveItem(Player, 5642)
     end
end

This will delete all quests items when the quest is deleted


Notes

This only removes one instance of an item, so if you have a stack of 5 and call this function it will now be a stack of 4

Can only be used on a player