overdriven
Active Member
- Joined
- Mar 10, 2020
- Messages
- 71
- Solutions
- 1
- Reaction score
- 41
Scenario: a lever removing blocking item. After many trial end error iterations I've finally made it working but code wise it just doesn't seem right:
Why do I have to remove the item twice?
If I try to remove the item from first stack position it doesn't do anything. If I try to remove it from second stack pos it doesn't work either. Only when I remove simultaneously from first and second stack pos it works. Very weird.
I'm using TFS 1.5 with Nekiro's downgrade (github.com/nekiro/TFS-1.5-Downgrades/tree/7.72).
Lua:
local blockingStonePos = {x = 32620, y = 31971, z = 11}
function onUse(player, item, fromPosition, itemEx, toPosition)
if(item.actionid == 52413) then
if(item.itemid == 1945) then
doTransformItem(item.uid, 1946)
doCreateItem(1304,1,blockingStonePos)
elseif(item.itemid == 1946) then
doTransformItem(item.uid, 1945)
doRemoveItem(getTileItemById(blockingStonePos,1304).uid, 1) -- with stack pos 1 alone it doesn't work!
doRemoveItem(getTileItemById(blockingStonePos,1304).uid, 2) -- with stack pos 2 alone it doesn't work!
end
end
return true
end
Why do I have to remove the item twice?
If I try to remove the item from first stack position it doesn't do anything. If I try to remove it from second stack pos it doesn't work either. Only when I remove simultaneously from first and second stack pos it works. Very weird.
I'm using TFS 1.5 with Nekiro's downgrade (github.com/nekiro/TFS-1.5-Downgrades/tree/7.72).