No categories assigned

LUA:RemoveItem

Revision as of 17:11, 7 May 2013 by Thefoof (talk | contribs) (Created page with "Removes 1 of an item from a target, and returns a true or false if successful or not. ==== Syntax ==== RemoveItem(target, item_id) ==== Usage ==== <pre> function Deleted(Quest...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Removes 1 of an item from a target, and returns a true or false if successful or not.

Syntax

RemoveItem(target, item_id)

Usage

function Deleted(Quest, QuestGiver, Player)
    if HasItem(Player, 46842) then
        if RemoveItem(46842) == true then
            Say(Player, "item removed")
        end
    end
end

This will delete an item with the id of 46842 from a player if they have that item, when a quest with this function is deleted, and have the player say "item removed" if the item was removed correctly.


Back to LUA General Functions Index