local cfg = {
tppos = {x=1000,y=1000,z=7}, ---place where tp be created
tpto = {x=1002,y=1000,z=7,stackpos = 1}, ---place where player be tped when enter tp
statuepos = {x=1005,y=998,z=7,stackpos = 1}, --place where statue is
statuetopos = {x=1003,y=998,z=7,stackpos = 1}, -- place where statue will go
tptime = 10, --time where it will be removed(seconds)
statuetime = 15, --time where it will be back to its place
id = 3742 -- id of statue
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tp = getThingFromPos(cfg.tppos)
local statue = getThingFromPos(cfg.statuetopos)
if tp.itemid == 1387 and statue.itemid == cfg.id then
doPlayerSendCancel(cid,"You can't use this yet!")
else
doCreateTeleport(1387, cfg.tpto, cfg.tppos)
doRemoveItem(getThingFromPos(cfg.statuepos).uid)
doCreateItem(cfg.id,1,cfg.statuetopos)
addEvent(doCleanTile,cfg.tptime * 1000,cfg.tppos)
addEvent(creat,cfg.statuetime * 1000)
end
return item.itemid == 1945 and doTransformItem(item.uid,1946) or doTransformItem(item.uid,1945)
end
function creat()
local statue = getThingFromPos(cfg.statuetopos)
doRemoveItem(statue.uid)
doCreateItem(cfg.id,1,cfg.statuepos)
end
<action actionid="XXX" event="script" value="xxxx.lua"/>
local cfg = {
tppos = {x=1005,y=856,z=3}, ---place where tp be created
tpto = {x=1053,y=855,z=7,stackpos = 1}, ---place where player be tped when enter tp
statuepos = {x=1050,y=855,z=7,stackpos = 1}, --place where statue is
statuetopos = {x=1050,y=856,z=7,stackpos = 1}, -- place where statue will go
tptime = 10, --time where it will be removed(seconds)
statuetime = 15, --time where it will be back to its place
id = 7825 -- id of statue
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tp = getThingFromPos(cfg.tppos)
local statue = getThingFromPos(cfg.statuetopos)
if tp.itemid == 1387 and statue.itemid == cfg.id then
doPlayerSendCancel(cid,"You can't use this yet!")
else
doCreateTeleport(1387, cfg.tpto, cfg.tppos)
doRemoveItem(getThingFromPos(cfg.statuepos).uid)
doCreateItem(cfg.id,1,cfg.statuetopos)
addEvent(doCleanTile,cfg.tptime * 1000,cfg.tppos)
addEvent(creat,cfg.statuetime * 1000)
end
return item.itemid == 1945 and doTransformItem(item.uid,1946) or doTransformItem(item.uid,1945)
end
function creat()
local statue = getThingFromPos(cfg.statuetopos)
doRemoveItem(statue.uid)
doCreateItem(cfg.id,1,cfg.statuepos)
end
local cfg = {
tppos = {x=1000,y=1000,z=7}, ---place where tp be created
tpto = {x=1002,y=1000,z=7,stackpos = 1}, ---place where player be tped when enter tp
statuepos = {x=1005,y=998,z=7,stackpos = 1}, --place where statue is
statuetopos = {x=1003,y=998,z=7,stackpos = 1}, -- place where statue will go
tptime = 10, --time where it will be removed(seconds)
statuetime = 15, --time where it will be back to its place
id = 3742 -- id of statue
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tp = getThingFromPos(cfg.tppos)
local statue = getThingFromPos(cfg.statuetopos)
if tp.itemid == 1387 or statue.itemid == cfg.id then
doPlayerSendCancel(cid,"You can't use this yet!")
else
doCreateTeleport(1387, cfg.tpto, cfg.tppos)
doRemoveItem(getThingFromPos(cfg.statuepos).uid)
doCreateItem(cfg.id,1,cfg.statuetopos)
addEvent(doCleanTile,cfg.tptime * 1000,cfg.tppos)
addEvent(creat,cfg.statuetime * 1000)
end
return item.itemid == 1945 and doTransformItem(item.uid,1946) or doTransformItem(item.uid,1945)
end
function creat()
local statue = getThingFromPos(cfg.statuetopos)
doRemoveItem(statue.uid)
doCreateItem(cfg.id,1,cfg.statuepos)
end