• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Check if target item is on backpack

  • Thread starter Thread starter Evil Puncker
  • Start date Start date
E

Evil Puncker

Guest
How do I check and allow the use of an item onUse action to be performed only if target item is in character backpack, not anywhere else:

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.itemid == 2782 then
        target:transform(2781)
        target:decay()
        return true
    end
    return destroyItem(player, target, toPosition)
end

I'm using TFS 1.3 latest one
 

Similar threads

V
Replies
2
Views
127
Back
Top