• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

versperoth script change

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
hello i got this versperoth script that when it kills it transform its hole into a tp but the tp is not working properly, in this case to give a proper solution i would like to when you kill the miniboss transform the hole into a teleport with action id 25701.

script>
LUA:
local teleportPosition = Position(683, 417, 15)

local function transformTeleport()
    local teleportItem = Tile(teleportPosition):getItemById(1387)
    if not teleportItem then
        return
    end

    teleportItem:transform(18463)
end

local function clearArena()
    local spectators = Game.getSpectators(Position(696, 451, 15), false, false, 15, 15, 15, 15)
    local exitPosition = Position(601, 451, 15)
    for i = 1, #spectators do
        local spectator = spectators[i]
        if spectator:isPlayer() then
            spectator:teleportTo(exitPosition)
            exitPosition:sendMagicEffect(CONST_ME_TELEPORT)
            spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You were teleported out by the gnomish emergency device.')
        else
            spectator:remove()
        end
    end
end

function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

    if targetMonster:getName():lower() ~= 'versperoth' then
        return true
    end

    Game.setStorageValue(GlobalStorage.Versperoth.Battle, 2)
    addEvent(Game.setStorageValue, 30 * 60 * 1000, GlobalStorage.Versperoth.Battle, 0)

    local holeItem = Tile(teleportPosition):getItemById(18462)
    if holeItem then
        holeItem:transform(1387)
    end
    --Game.createMonster('abyssador', Position(696, 456, 15))

    addEvent(transformTeleport, 30 * 60 * 1000)
    addEvent(clearArena, 32 * 60 * 1000)
    return true
end
Im using tfs 1.3thanks !
 
Solution
should i put in in creaturescript or movement im confused i just saw an identical script on movement
i change it on creature script i got this error

View attachment 35015
lol
In creaturescripts, did you put all contents? I sent only part of them.

This should be:
LUA:
local teleportPosition = Position(683, 417, 15)

local function transformTeleport()
    local teleportItem = Tile(teleportPosition):getItemById(1387)
    if not teleportItem then
        return
    end

    teleportItem:transform(18463)
end

local function clearArena()
    local spectators = Game.getSpectators(Position(696, 451, 15), false, false, 15, 15, 15, 15)
    local exitPosition = Position(601, 451, 15)
    for i = 1, #spectators do
        local spectator =...
LUA:
local teleportPosition = Position(683, 417, 15)

local function transformTeleport()
    local teleportItem = Tile(teleportPosition):getItemById(1387)
    if not teleportItem then
        return
    end

    teleportItem:transform(18463)
end

local function clearArena()
    local spectators = Game.getSpectators(Position(696, 451, 15), false, false, 15, 15, 15, 15)
    local exitPosition = Position(601, 451, 15)
    for i = 1, #spectators do
        local spectator = spectators[i]
        if spectator:isPlayer() then
            spectator:teleportTo(exitPosition)
            exitPosition:sendMagicEffect(CONST_ME_TELEPORT)
            spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You were teleported out by the gnomish emergency device.')
        else
            spectator:remove()
        end
    end
end

function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

    if targetMonster:getName():lower() ~= 'versperoth' then
        return true
    end

    Game.setStorageValue(GlobalStorage.Versperoth.Battle, 2)
    addEvent(Game.setStorageValue, 30 * 60 * 1000, GlobalStorage.Versperoth.Battle, 0)

    local holeItem = Tile(teleportPosition):getItemById(18462)
    if holeItem then
        holeItem:transform(1387):setActionId(25701)
    end
    --Game.createMonster('abyssador', Position(696, 456, 15))

    addEvent(transformTeleport, 30 * 60 * 1000)
    addEvent(clearArena, 32 * 60 * 1000)
    return true
end
Try this
So hard to copy and paste on a phone. Can't we get a select code button or something.
 
LUA:
local teleportPosition = Position(683, 417, 15)

local function transformTeleport()
    local teleportItem = Tile(teleportPosition):getItemById(1387)
    if not teleportItem then
        return
    end

    teleportItem:transform(18463)
end

local function clearArena()
    local spectators = Game.getSpectators(Position(696, 451, 15), false, false, 15, 15, 15, 15)
    local exitPosition = Position(601, 451, 15)
    for i = 1, #spectators do
        local spectator = spectators[i]
        if spectator:isPlayer() then
            spectator:teleportTo(exitPosition)
            exitPosition:sendMagicEffect(CONST_ME_TELEPORT)
            spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You were teleported out by the gnomish emergency device.')
        else
            spectator:remove()
        end
    end
end

function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

    if targetMonster:getName():lower() ~= 'versperoth' then
        return true
    end

    Game.setStorageValue(GlobalStorage.Versperoth.Battle, 2)
    addEvent(Game.setStorageValue, 30 * 60 * 1000, GlobalStorage.Versperoth.Battle, 0)

    local holeItem = Tile(teleportPosition):getItemById(18462)
    if holeItem then
        holeItem:transform(1387):setActionId(25701)
    end
    --Game.createMonster('abyssador', Position(696, 456, 15))

    addEvent(transformTeleport, 30 * 60 * 1000)
    addEvent(clearArena, 32 * 60 * 1000)
    return true
end
Try this
So hard to copy and paste on a phone. Can't we get a select code button or something.

thnkas for the response
i got this error when killing versperoth and tp not working
35011
 
LUA:
function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

    if targetMonster:getName():lower() ~= 'versperoth' then
        return true
    end

    Game.setStorageValue(GlobalStorage.Versperoth.Battle, 2)
    addEvent(Game.setStorageValue, 30 * 60 * 1000, GlobalStorage.Versperoth.Battle, 0) -- 30 minutes

    local holeItem = Tile(teleportPosition):getItemById(18462)
    if holeItem then
        holeItem:remove()
        local TPItem = Game.createItem(1387, 1, teleportPosition)       
        TPItem:setActionId(25701)   -- actionID in movements.xml    
    end

    addEvent(transformTeleport, 30 * 60 * 1000)
    addEvent(clearArena, 32 * 60 * 1000)
    return true
end
 
LUA:
function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

    if targetMonster:getName():lower() ~= 'versperoth' then
        return true
    end

    Game.setStorageValue(GlobalStorage.Versperoth.Battle, 2)
    addEvent(Game.setStorageValue, 30 * 60 * 1000, GlobalStorage.Versperoth.Battle, 0) -- 30 minutes

    local holeItem = Tile(teleportPosition):getItemById(18462)
    if holeItem then
        holeItem:remove()
        local TPItem = Game.createItem(1387, 1, teleportPosition)      
        TPItem:setActionId(25701)   -- actionID in movements.xml   
    end

    addEvent(transformTeleport, 30 * 60 * 1000)
    addEvent(clearArena, 32 * 60 * 1000)
    return true
end

should i put in in creaturescript or movement im confused i just saw an identical script on movement
i change it on creature script i got this error

35015
 
should i put in in creaturescript or movement im confused i just saw an identical script on movement
i change it on creature script i got this error

View attachment 35015
lol
In creaturescripts, did you put all contents? I sent only part of them.

This should be:
LUA:
local teleportPosition = Position(683, 417, 15)

local function transformTeleport()
    local teleportItem = Tile(teleportPosition):getItemById(1387)
    if not teleportItem then
        return
    end

    teleportItem:transform(18463)
end

local function clearArena()
    local spectators = Game.getSpectators(Position(696, 451, 15), false, false, 15, 15, 15, 15)
    local exitPosition = Position(601, 451, 15)
    for i = 1, #spectators do
        local spectator = spectators[i]
        if spectator:isPlayer() then
            spectator:teleportTo(exitPosition)
            exitPosition:sendMagicEffect(CONST_ME_TELEPORT)
            spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You were teleported out by the gnomish emergency device.')
        else
            spectator:remove()
        end
    end
end

function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

    if targetMonster:getName():lower() ~= 'versperoth' then
        return true
    end

    Game.setStorageValue(GlobalStorage.Versperoth.Battle, 2)
    addEvent(Game.setStorageValue, 30 * 60 * 1000, GlobalStorage.Versperoth.Battle, 0) -- 30 minutes

    local holeItem = Tile(teleportPosition):getItemById(18462)
    if holeItem then
        holeItem:remove()
        local TPItem = Game.createItem(1387, 1, teleportPosition)       
        TPItem:setActionId(25701)   -- actionID in movements.xml   
    end

    addEvent(transformTeleport, 30 * 60 * 1000)
    addEvent(clearArena, 32 * 60 * 1000)
    return true
end
 
Solution
Back
Top