Code:
function onUse(cid, item, fromPos, item2, toPos)
local switchUniqueID = 19000 -- uniqueID of switch
local switchID = 1945
local switch2ID = 1946
local wallpos = {x=1145, y=1231, z=9, stackpos=1}
local wallchk = getThingfromPos(wallpos)
if item.uid == switchUniqueID and item.itemid == switchID and wallchk.itemid == 3362 then
doSendMagicEffect(wallchk,10)
doRemoveItem(wallchk.uid,1)
doTransformItem(item.uid,item.itemid+1)
addEvent(onTimer1, 1*60*1000)
elseif item.uid == switchUniqueID and item.itemid == switch2ID then
doTransformItem(item.uid,item.itemid-1)
end
return TRUE
end
function onTimer1()
wallnewpos = {x=1145, y=1231, z=9}
doCreateItem(3362,1,wallnewpos)
end
well i want the code to work, but right now the only thing that dosnt work is the adEvent timer. anything can se something wrong with that part?