local config = {
toPos = {x = 92, y = 119, z = 7},
tpPositions = {
{x = 100, y = 219, z = 7},
{x = 100, y = 519, z = 7},
{x = 140, y = 663, z = 7},
{x = 200, y = 715, z = 7},
{x = 223, y = 754, z = 7}
}
}
function doRemoveTeleport(pos)
doRemoveItem(getTileItemById(pos, 1387).uid, 1)
doBroadcastMessage("The teleport is removed.")
return true
end
function doCreateTeleportx()
local createpos = config.tpPositions[math.random(#config.tpPositions)]
local tp = doCreateTeleport(1387, config.toPos, createpos)
doItemSetAttribute(tp, "aid", 6096)
doBroadcastMessage("The teleport is created.")
addEvent(doRemoveTeleport, 60 * 1000, createpos)
return true
end
function onThink(interval, lastExecution)
doBroadcastMessage("The teleport will be created in 20 seconds!")
addEvent(doCreateTeleportx, 20 * 1000)
return true
end