local gatepos = {[COLOR="Red"]x=2446, y=2854, z=15[/COLOR], stackpos=1}
local newstone = 0
function onUse(cid, item, frompos, item2, topos)
local getgate = getThingfromPos(gatepos)
if(item.uid == [COLOR="Lime"]10200[/COLOR]) then
if(item.itemid == 1945 and getgate.itemid == [COLOR="DarkOrange"]1355[/COLOR]) then
doRemoveItem(getgate.uid, 1)
doTransformItem(item.uid, 1946)
newstone = addEvent(recreateStone, 1000*[COLOR="RoyalBlue"]30[/COLOR], {pos = gatepos, item = item})
elseif(item.itemid == 1946 and getgate.itemid == 0) then
doCreateItem([COLOR="DarkOrange"]1355[/COLOR],1,gatepos)
doTransformItem(item.uid, 1945)
stopEvent(newstone)
end
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return TRUE
end
function recreateStone(param)
doCreateItem([COLOR="DarkOrange"]1355[/COLOR], 1, param.pos)
doTransformItem(param.item.uid, 1945)
newstone = 0
end