• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Boss Tp

have a look at this post, the 2nd comment adds a script for 1.3+, might help u get started.

 
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
Lua:
-- 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()

and also requires adding event to the creature.
example:

Code:
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"
}
 
Back
Top