Figaro
Banned User
How to make this? Every 1 hour tp comes to pos 100 100 7 as example, it stays there 5min and then it goes away. And again in next hour it comes there. Hope soembody can help.
<globalevent name="specialTP" interval="3600" event="script" value="specialTP.lua"/>
tpPos = {x=100, y=100, z=7}
tpToPos = {x=200, y=200, z=7}
tpItemID = 1387
tpDisappearTime = 5 * 60 -- 5 * 60 = 5 minutes
function onThink(interval, lastExecution)
local tp_uid = doCreateTeleport(tpItemID, tpToPos, tpPos)
addEvent(doRemoveItem, tpDisappearTime * 1000, tp_uid)
return TRUE
end
tpPos = {x=100, y=100, z=7}
tpToPos = {x=200, y=200, z=7}
tpItemID = 1387
tpDisappearTime = 5 * 60 -- 5 * 60 = 5 minutes
function doRemoveSpecialTP()
local tp_item = getTileItemByType(tpPos, ITEM_TYPE_TELEPORT)
if tp_item.uid > 0 then
doRemoveItem(tp_item.uid)
end
end
function onThink(interval, lastExecution)
local tp_uid = doCreateTeleport(tpItemID, tpToPos, tpPos)
addEvent(doRemoveSpecialTP, tpDisappearTime * 1000)
return TRUE
end
[07/06/2009 19:15:33] Lua Script Error: [GlobalEvent Interface]
[07/06/2009 19:15:33] in a timer event called from:
[07/06/2009 19:15:33] data/globalevents/scripts/openbattletp.lua:onThink
[07/06/2009 19:15:33] luaDoRemoveItem(). Item not found