function onThink(interval, lastExecution, thinkInterval)
local pos = {x = 1954, y = 879, z = 10} --- Where tp gonna go
local tpcreate = {x = 1954, y = 879, z = 10} --- where to create the tp
doCreateTeleport(1387, pos, tpcreate)
return true
end
<globalevent name="tp" interval="2000" event="script" value="tp.lua"/>
Make an global event with inteval. And local = pos bla bla where the teleport gonna lead
try make something like:
LUA:function onThink(interval, lastExecution, thinkInterval) local pos = {x = 1954, y = 879, z = 10} --- Where tp gonna go local tpcreate = {x = 1954, y = 879, z = 10} --- where to create the tp doCreateTeleport(1387, pos, tpcreate) return true end
Then add line to globalevents.xml like :
LUA:<globalevent name="tp" interval="2000" event="script" value="tp.lua"/>
local config = {
topos = {x=94,y=119,z=7}, -- where player goes to
tppos= {x=94,y=117,z=7}, -- where teleport is created
removetime = 60 -- time in seconds
}
function removeTele()
doRemoveItem(getTileItemById(config.tppos,1387).uid,1)
doBroadcastMessage("The teleport is removed.")
return true
end
function onThink(interval, lastExecution)
doBroadcastMessage("The teleport is created!")
doCreateTeleport(1387, config.topos, config.tppos)
addEvent(removeTele, config.removetime * 1000)
return true
end
LUA:local config = { topos = {x=94,y=119,z=7}, -- where player goes to tppos= {x=94,y=117,z=7}, -- where teleport is created removetime = 60 -- time in seconds } function removeTele() doRemoveItem(getTileItemById(config.tppos,1387).uid,1) doBroadcastMessage("The teleport is removed.") return true end function onThink(interval, lastExecution) doBroadcastMessage("The teleport is created!") doCreateTeleport(1387, config.topos, config.tppos) addEvent(removeTele, config.removetime * 1000) return true end
If I may ask.
Did u create that script now?
Or you have it from someone?