Call Me saul
New Member
TFS 1.4.2
i need a script when boss died tp open for like 2-3 mins then close
i need a script when boss died tp open for like 2-3 mins then close
TFS 1.4.2
i need a script when boss died tp open for like 2-3 mins then close
TFS 1.4.2
i need a script when boss died tp open for like 2-3 mins then close
-- Configuration
local monsterName = "Dragon"
local teleportPosition = Position(2500, 2500, 7)
local destinationPosition = Position(2500, 2505, 7)
local teleportItemId = 1949 -- ID of the teleport item
local removalDelay = 1 * 60 * 1000 -- 1 minutes in milliseconds
local function removeTeleport(position)
local tile = Tile(position)
if tile then
local teleport = tile:getItemById(teleportItemId)
if teleport then
teleport:remove()
end
end
end
local function createTeleport(position, destination, delay)
local tile = Tile(position)
if tile then
local teleport = Game.createItem(teleportItemId, 1, position)
if teleport then
teleport:setDestination(destination)
-- Schedule removal of the teleport
addEvent(removeTeleport, delay, position)
end
end
end
local dragonDeath = CreatureEvent("DragonDeath")
function dragonDeath.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
if creature:getName():lower() == monsterName:lower() then
createTeleport(teleportPosition, destinationPosition, removalDelay)
end
return true
end
dragonDeath:register()
local mType = Game.createMonsterType("Dragon")
local monster = {}
monster.description = "a dragon"
monster.experience = 700
monster.outfit = {
lookType = 34,
lookHead = 0,
lookBody = 0,
lookLegs = 0,
lookFeet = 0,
lookAddons = 0,
lookMount = 0
}
monster.events = {
"DragonDeath"
}