• 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!

Console error function killing verseperoth

wafuboe

Member
Joined
Dec 24, 2010
Messages
881
Solutions
2
Reaction score
22
When i kill verseperoth i got this error, also i cannot proceed to abyssador boos on warzone 3
got this error on console
2uqf4wp.png


heres the script
Code:
local versperothPosition = Position(683, 417, 15)

local function removeMinion(mid)
    local monster = Monster(mid)
    if monster then
        monster:getPosition():sendMagicEffect(CONST_ME_POFF)
        monster:remove()
    end
end

local function executeVersperothBattle(mid)
    if getGlobalStorageValue(3147) ~= 1 then
        return
    end

    if mid then
        local monster = Monster(mid)
        if not monster then
            return
        end

        setGlobalStorageValue(3148, monster:getMaxHealth() - monster:getHealth())
        monster:remove()
        versperothPosition:sendMagicEffect(CONST_ME_POFF)

        local position, minionMonster
        for i = 1, math.random(8, 10) do
            position = Position(math.random(674, 693), math.random(408, 424), 15)
            minionMonster = Game.createMonster('Minion of Versperoth', position)
            position:sendMagicEffect(CONST_ME_TELEPORT)
            if minionMonster then
                addEvent(removeMinion, 20 * 1000, minionMonster:getId())
            end
        end
        addEvent(executeVersperothBattle, 10 * 1000)
        return
    end

    local monster = Game.createMonster('Versperoth', versperothPosition, false, true)
    if monster then
        versperothPosition:sendMagicEffect(CONST_ME_GROUNDSHAKER)
        monster:addHealth(-(getGlobalStorageValue(3148) or -1))

        addEvent(executeVersperothBattle, 20 * 1000, monster:getId())
    end
end


function onStepIn(cid, item, position, lastPosition)
    local player = Player(cid)
    if not player then
        return true
    end

    if getGlobalStorageValue(3147) < 1 then
        player:teleportTo(Position(689, 444, 15))
        setGlobalStorageValue(3147, 1)
        setGlobalStorageValue(3148, 0)
        executeVersperothBattle()
        Item(item.uid):transform(18462)
    else
        doPlayerSendCancel(cid, "Wait 30 minutes to start again.")
        player:teleportTo(lastPosition)
        end
    return true
end
 
Back
Top