local config = {
itemid = 1304, -- ID Do Item
pos = {x=96, y=38, z=7}, -- Posição do item
pos2 = {x=97, y=38, z=7}, -- Posição do item 2
tempo = 30, -- tempo para as stones voltarem, em segundos.
}
function onUse(cid, item, frompos, item2, topos)
local stid, stid2 = getTileItemById(config.pos, config.itemid), getTileItemById(config.pos2, config.itemid)
if stid.uid > 0 and stid2.uid > 0 then
doRemoveItemFromPos(config.pos, config.itemid, 1)
doRemoveItemFromPos(config.pos2, config.itemid, 1)
addEvent(doBackStones, config.tempo * 1000)
end
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return true
end
function doRemoveItemFromPos(position, itemid, count)
local item = getTileItemById(position, itemid)
if item.uid ~= 0 then
return doRemoveItem(item.uid, count or -1)
end
return FALSE
end
function doBackStones()
doCreateItem(config.itemid, 1, config.pos)
doCreateItem(config.itemid2, 1, config.pos2)
end
Pronto! Boa sorte.
up!