local config = {
message = "Go into the teleport in 120 seconds, else it will disappear.",
timeToRemove = 120, -- seconds
teleportId = 1387,
bosses = { -- Monster Name, Teleport To Position, Teleport Position
["Hellgorak"] = { { x = 1192, y = 1240, z = 12 }, { x = 1066, y = 1057, z = 14, stackpos = 1 } },
}
local function removal(position)
if getThingfromPos(position).itemid == config.teleportId then
doRemoveItem(getThingfromPos(position).uid)
end
return TRUE
end
function onKill(cid, target, lastHit)
local position = getCreaturePosition(cid)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(target) then
teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, pos[2])
end
end
return TRUE
end
Rep +++
Code:local config = { message = "Go into the teleport in 120 seconds, else it will disappear.", timeToRemove = 120, -- seconds teleportId = 1387, bosses = { -- Monster Name, Teleport To Position, Teleport Position ["Hellgorak"] = { { x = 1192, y = 1240, z = 12 }, { x = 1066, y = 1057, z = 14, stackpos = 1 } }, } local function removal(position) if getThingfromPos(position).itemid == config.teleportId then doRemoveItem(getThingfromPos(position).uid) end return TRUE end function onKill(cid, target, lastHit) local position = getCreaturePosition(cid) for name, pos in pairs(config.bosses) do if name == getCreatureName(target) then teleport = doCreateTeleport(config.teleportId, pos[1], pos[2]) doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1) addEvent(removal, config.timeToRemove * 1000, pos[2]) end end return TRUE end