The script is : I put a gold coin in the conter and press the lever, then the wall disappear.
Well... the problem is in line 10
When i start the server, isn't working, but, when i remove the part of line 10 do /reload action , put new walls and put the part of line 10 again it Works perfectly...
WHY?
Well... the problem is in line 10
Code:
and getpiece1.itemid == 9485 and getpiece4.itemid == 2148
WHY?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
piece1pos = {x=2022, y=2073, z=8, stackpos=1}
piece2pos = {x=2023, y=2073, z=8, stackpos=1}
piece3pos = {x=2024, y=2073, z=8, stackpos=1}
piece4pos = {x=2026, y=2073, z=8, stackpos=255} -- gold
getpiece1 = getThingfromPos(piece1pos)
getpiece2 = getThingfromPos(piece2pos)
getpiece3 = getThingfromPos(piece3pos)
getpiece4 = getThingfromPos(piece4pos)
if item.uid == 30005 and item.itemid == 9531 and getpiece1.itemid == 9485 and getpiece4.itemid == 2148 then
doRemoveItem(getpiece1.uid,1)
doRemoveItem(getpiece2.uid,1)
doRemoveItem(getpiece3.uid,1)
doRemoveItem(getpiece4.uid,1)
doPlayerSendTextMessage(cid,22,"Oh it's open!")
addEvent(doCreateItem, 1*10*1000, 9485, piece1pos)
addEvent(doCreateItem, 1*10*1000, 9485, piece2pos)
addEvent(doCreateItem, 1*10*1000, 9485, piece3pos)
else
doPlayerSendTextMessage(cid,22,"You can't do this now.")
end
return 1
end