local bosses = {
['demon'] = 50000 ------------> storange can change it for which you do not occupy
}
function onKill(player, target)
local targetMonster = target:getMonster()
if not targetMonster then
return true
end
local targetName = targetMonster:getName():lower()
local bossStorage = bosses[targetName]
if not bossStorage then
return true
end
local function deleteTeleport(position)
local teleport = Tile(position):getItemById(1387)
if teleport then
teleport:remove()
end
end
local newValue = 2
Game.setStorageValue(bossStorage, newValue)
local item = Game.createItem(1387, 1,{x = 33548, y = 31623, z = 8}) ------> where will be created
if item:isTeleport() then
item:setDestination({x = 33495, y = 31583, z = 7}) ------> where will teleport you?
end
if newValue == 2 then
player:say('You now have 1 minute to exit this room through the teleporter.', TALKTYPE_MONSTER_SAY)
addEvent(deleteTeleport, 1 * 60 * 1000, {x = 33548, y = 31623, z = 8}) ------> where will remove
end
return true
end