local stonepos = {x=535, y=1266, z=10, stackpos=1} -- Stone pos
function onUse(cid, item, fromPos, item2, toPos)
if item.itemid == 1945 then
doRemoveItem(getThingfromPos(stonepos).uid, 1)
doTransformItem(item.uid,1946)
addEvent(onTimer5, 2*60*1000) --2minutes
end
return true
end
function onTimer5() --creates wall back
doTransformItem(getThingFromPos({x=535, y=1251, z=10, stackpos=1}).uid, 1945)--lever pos
doCreateItem(1304,1,{x=535, y=1266, z=10})-- Stone pos
end
local pos, e = {x=535, y=1266, z=10}, 0
local f = function(p)
doCreateItem(1304, 1, pos)
doTransformItem(getTileItemById(p, 1946).uid, 1945)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
doRemoveItem(getTileItemById(pos, 1304).uid)
e = addEvent(f, 5 * 60 * 1000, fromPosition)
doTransformItem(item.uid, 1946)
else
stopEvent(e)
e = 0
f(fromPosition)
end
return true
end
Lua:local pos, e = {x=535, y=1266, z=10}, 0 local f = function(p) doCreateItem(1304, 1, pos) doTransformItem(getTileItemById(p, 1946).uid, 1945) end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 1945 then doRemoveItem(getTileItemById(pos, 1304).uid) e = addEvent(f, 5 * 60 * 1000, fromPosition) doTransformItem(item.uid, 1946) else stopEvent(e) e = 0 f(fromPosition) end return true end
local pos, e = {x=1689, y=1091, z=9}, 0
local f = function(p)
doCreateItem(1049, 1, pos)
doTransformItem(getTileItemById(p, 1946).uid, 1945)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
doRemoveItem(getTileItemById(pos, 1049).uid)
e = addEvent(f, 5 * 60 * 1000, fromPosition)
doTransformItem(item.uid, 1946)
else
stopEvent(e)
e = 0
f(fromPosition)
end
return true
end
Lua:local pos, e = {x=535, y=1266, z=10}, 0 local f = function(p) doCreateItem(1304, 1, pos) doTransformItem(getTileItemById(p, 1946).uid, 1945) end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 1945 then doRemoveItem(getTileItemById(pos, 1304).uid) e = addEvent(f, 5 * 60 * 1000, fromPosition) doTransformItem(item.uid, 1946) else stopEvent(e) e = 0 f(fromPosition) end return true end
it does not work on r3884.. pls help
got error on near `pos'