Hello, can someone explain to me how to make a lever and lock it for the next server save?
... so we can use only one time this lever who will open something on server save
FOR ANY TIPS BIG +++
... so we can use only one time this lever who will open something on server save
FOR ANY TIPS BIG +++
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local gatePos = {x=32010, y=32100, z=8, stackpos=1}
local nextTile = {x=gatePos.x, y=gatePos.y+1, z=gatePos.z}
local gateItem = getThingfromPos(gatePos)
if item.itemid == 1945 and gateItem.itemid == 1304 then
doRemoveItem(gateItem.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.itemid == 1946 then
doRelocate(gatePos, nextTile)
doCreateItem(1304,1,gatePos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end
return true
end