Apoccalypse
New Member
- Joined
- Apr 15, 2017
- Messages
- 114
- Solutions
- 2
- Reaction score
- 4
Hi guys,
I have a problem with my script:
So, here is a thing:
When I use the lever the script creates three items on one spot but when I use the lever again it removes only one item from the position. The console gives me an error but I have no freaking idea why it is so. The one item is removed but others two which are still there are not found. Why?
If anyone could help that would be great
I have a problem with my script:
LUA:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=458, y=1290, z=11, stackpos=1}
getgate = getThingfromPos(gatepos)
local storage = 12325
if item.uid == 12325 and item.itemid == 1945 then
if getPlayerStorageValue(cid, storage) == -1 then
doCreatureSay(cid,"The lever seems to be very rusty. Use the oil to move it!",TALKTYPE_ORANGE_1)
return true
end
doTransformItem(item.uid,item.itemid+1)
doCreateItem(5771 ,1,gatepos)
doCreateItem(5772 ,1,gatepos)
doCreateItem(1284 ,1,gatepos)
doCreatureSay(cid,"The bridge has been created. Hurry up!",TALKTYPE_ORANGE_1)
elseif item.uid == 12325 and item.itemid == 1946 then
doRemoveItem(getgate.uid,1)
doRemoveItem(getgate.uid,1)
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid-1)
end
return 1
end
So, here is a thing:
When I use the lever the script creates three items on one spot but when I use the lever again it removes only one item from the position. The console gives me an error but I have no freaking idea why it is so. The one item is removed but others two which are still there are not found. Why?
If anyone could help that would be great

Code:
[18:44:38.823] [Error - Action Interface]
[18:44:38.828] data/actions/scripts/Poi/dzwigniaOil.lua:onUse
[18:44:38.829] Description:
[18:44:38.829] (luaDoRemoveItem) Item not found
[18:44:38.831] [Error - Action Interface]
[18:44:38.831] data/actions/scripts/Poi/dzwigniaOil.lua:onUse
[18:44:38.831] Description:
[18:44:38.831] (luaDoRemoveItem) Item not found