The TP spawns, but doesnt disappear after 60 sec :s Anyone know why?
Code:
local config = {
message = "Go into the teleport in 60 seconds, else it will disappear.",
timeToRemove = 60, -- seconds
teleportId = 1387,
bosses = { -- Monster Name, Teleport To Position, Teleport Position
["Eternal Oblivion"] = { { x = 1047, y = 346, z = 5, stackpos = 1 }, { x = 1129, y = 297, z = 11 }},
["Ryze"] = { { x = 776, y = 934, z = 4, stackpos = 1 }, { x = 777, y = 916, z = 4 }}
}
}
local function removal(position)
if getThingfromPos(position).itemid == config.teleportId then
doRemoveItem(getThingfromPos(position).uid)
end
return TRUE
end
function onKill(cid, target, lastHit)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(target) then
teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
if teleport == FALSE then
print("Create teleport failed. Check ID, position1 and position2")
return TRUE
end
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, pos[1], pos[2])
end
end
return TRUE
end