when a player is standing over an lever that I want do transform to 1945, i need to use stackpos 2...
doTransformItem(getThingfromPos({x=32763,y=32291,z=14,stackpos = 2}).uid,1945)
but when there is no one over it, its stackpos 1...
doTransformItem(getThingfromPos({x=32763,y=32291,z=14,stackpos = 1}).uid,1945)
BUT, is there any solution?? because i placed this 2 lines into my script, everytime someones does the action it send error in console ( because it will execute only one of the "doTransformItem" and the other will send an error... anyone mind fixing it for me??
doTransformItem(getThingfromPos({x=32763,y=32291,z=14,stackpos = 2}).uid,1945)
but when there is no one over it, its stackpos 1...
doTransformItem(getThingfromPos({x=32763,y=32291,z=14,stackpos = 1}).uid,1945)
BUT, is there any solution?? because i placed this 2 lines into my script, everytime someones does the action it send error in console ( because it will execute only one of the "doTransformItem" and the other will send an error... anyone mind fixing it for me??
Code:
if items > 0 and item.actionid == 5412 and getGlobalStorageValue(cid, 5410) <= 4 and item.itemid == 1945 then
if not isCreature(items) and not isPlayer(items) then
if isMovable(items) or getItemDescriptionsById(getThingFromPos(pos).itemid).type == ITEM_TYPE_MAGICFIELD then
doRemoveItem(items)
doCreateItem(1026,1,wall)
doCreateItem(1026,1,{x=wall.x+1,y=wall.y,z=wall.z, stackpos=1})
doCreateItem(1026,1,{x=wall.x+2,y=wall.y,z=wall.z, stackpos=1})
setGlobalStorageValue(cid, 5410, 0)
doTransformItem(getThingfromPos({x=32763,y=32291,z=14,stackpos = 2}).uid,1945)
doTransformItem(getThingfromPos({x=32763,y=32291,z=14,stackpos = 1}).uid,1945)