This work:
my_sack.containeritem:addItem(my_item.item)
But this do not:
my_sack.containeritem:removeItem(my_item.item)
Iam trying to make sack for specific items. So if you try to put inside wrong items, it wont let you and they spawn in front of party.
I figured everything else I just cant destroy or remove wrong item from sack
This is my code so far in sack item defineObejct:
Code: Select all
onInsertItem = function(self, item)
local itmName = item.go.name
local itm = item.go.id
local bag = "my_sack"
if itmName ~= "good_item" then
hudPrint("There goes only good items.") --work
spawn(itmName,party.level,party.x,party.y,party.facing,0) --work
bag.containeritem:removeItem(itm.item) -- doesnt work
end
end