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

Error on Warzone teleport

wafuboe

Member
Joined
Dec 24, 2010
Messages
881
Solutions
2
Reaction score
22
On ending the part of the crystal and the massive summon of fungi monsters, when entering the teleport, it doesnt work and i get this following error in console. TFS 1.3
If someone could help me i appreciate it

i1zc49.png


Code:
if not warzoneConfig then
    warzoneConfig = {
        -- Warzone 
        [45700] = {  -- action do movement
            center = Position(813, 623, 14),   -- centro da room do boss
            rangeX = 27, rangeY = 25,

            boss = "Gnomevil",   -- nome do boss 
            teleportTo = Position(801, 616, 14),   -- Local onde o player será teleportado dentro da room
            locked = false,

            storage = 790014,    -- storage 
            interval = 10 * 60 * 60,

            exit = Position(630, 483, 14)   -- Exit padrão
        },
       
       
        -- Warzone 
        [45702] = {  -- action do movement
            center = Position(816, 668, 15), -- centro da room do boss
            rangeX = 26, rangeY = 25,

            boss = "Deathstrike",   -- nome do boss 
            teleportTo = Position(806, 658, 15),   -- Local onde o player será teleportado dentro da room
            locked = false,

            storage = 790015,    -- storage 
            interval = 10 * 60 * 60,

             exit = Position(630, 483, 14)   -- Exit padrão
        },
       
        -- Warzone 
        [45701] = {  -- action do movement
            center = Position(698, 449, 15), 
            rangeX = 20, rangeY = 20,

            boss = "Abyssador",   -- nome do boss 
            teleportTo = Position(689, 441, 15),  -- Local onde o player será teleportado dentro da room
            locked = false,

            storage = 790016,    -- storage 
            interval = 10 * 60 * 60,

             exit = Position(630, 483, 14)   -- Exit padrão
        }
       
       
    }

    warzoneConfig.findByName = function(name, last)
        local i, v = next(warzoneConfig, last)
        if type(v) == 'table' and v.boss == name then
            return v
        elseif not i then
            return nil
        end
        return warzoneConfig.findByName(name, i)
    end
end

local function filter(list, f, i)
    if i < #list then
        if f(list[i]) then
            return list[i], filter(list, f, i + 1)
        else
            return filter(list, f, i + 1)
        end
    elseif list[i] and f(list[i]) then
        return list[i]
    end
end

function onStepIn(creature, item, pos, fromPosition)
    if not creature:isPlayer() then
        creature:teleportTo(fromPosition)
        return false
    end

    local info = warzoneConfig[item:getActionId()]
    if not info then
        return false
    end

    if  creature:getStorageValue(info.storage) > os.time() then
        creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have already cleared this warzone in the last ten hours.")
        creature:teleportTo(fromPosition)
        return false
    end

    if info.locked then
        creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Please, wait a minute until the room is cleared.")
        creature:teleportTo(fromPosition)
        return false
    end

    creature:teleportTo(info.teleportTo)
    local spectators = Game.getSpectators(info.center, false, false, 0, info.rangeX, 0, info.rangeY)
    if not filter(spectators, function(c) return c:isMonster() end, 1) then
        local boss = Game.createMonster(info.boss, info.center)
        boss:registerEvent('WarzoneBossDeath')
    end

    return true
end
 
Last edited:
Solution
Lua:
if not warzoneConfig then
    warzoneConfig = {
        -- Warzone
        [45700] = {  -- action do movement
            center = Position(813, 623, 14),   -- centro da room do boss
            rangeX = 27, rangeY = 25,

            boss = "Gnomevil",   -- nome do boss
            teleportTo = Position(801, 616, 14),   -- Local onde o player será teleportado dentro da room
            locked = false,

            storage = 790014,    -- storage
            interval = 10 * 60 * 60,

            exit = Position(630, 483, 14)   -- Exit padrão
        },
       
       
        -- Warzone
        [45702] = {  -- action do movement
            center = Position(816, 668, 15), -- centro da room do boss
            rangeX = 26, rangeY = 25...
Lua:
if not warzoneConfig then
    warzoneConfig = {
        -- Warzone
        [45700] = {  -- action do movement
            center = Position(813, 623, 14),   -- centro da room do boss
            rangeX = 27, rangeY = 25,

            boss = "Gnomevil",   -- nome do boss
            teleportTo = Position(801, 616, 14),   -- Local onde o player será teleportado dentro da room
            locked = false,

            storage = 790014,    -- storage
            interval = 10 * 60 * 60,

            exit = Position(630, 483, 14)   -- Exit padrão
        },
       
       
        -- Warzone
        [45702] = {  -- action do movement
            center = Position(816, 668, 15), -- centro da room do boss
            rangeX = 26, rangeY = 25,

            boss = "Deathstrike",   -- nome do boss
            teleportTo = Position(806, 658, 15),   -- Local onde o player será teleportado dentro da room
            locked = false,

            storage = 790015,    -- storage
            interval = 10 * 60 * 60,

             exit = Position(630, 483, 14)   -- Exit padrão
        },
       
        -- Warzone
        [45701] = {  -- action do movement
            center = Position(698, 449, 15),
            rangeX = 20, rangeY = 20,

            boss = "Abyssador",   -- nome do boss
            teleportTo = Position(689, 441, 15),  -- Local onde o player será teleportado dentro da room
            locked = false,

            storage = 790016,    -- storage
            interval = 10 * 60 * 60,

             exit = Position(630, 483, 14)   -- Exit padrão
        }
       
       
    }

    warzoneConfig.findByName = function(name, last)
        local i, v = next(warzoneConfig, last)
        if type(v) == 'table' and v.boss == name then
            return v
        elseif not i then
            return nil
        end
        return warzoneConfig.findByName(name, i)
    end
end

local function filter(list, f, i)
    if i < #list then
        if f(list[i]) then
            return list[i], filter(list, f, i + 1)
        else
            return filter(list, f, i + 1)
        end
    elseif list[i] and f(list[i]) then
        return list[i]
    end
end

function onStepIn(creature, item, pos, fromPosition)
    if not creature:isPlayer() then
        creature:teleportTo(fromPosition)
        return false
    end

    local info = warzoneConfig[item:getActionId()]
    if not info then
        return false
    end

    if  creature:getStorageValue(info.storage) > os.time() then
        creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have already cleared this warzone in the last ten hours.")
        creature:teleportTo(fromPosition)
        return false
    end

    if info.locked then
        creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Please, wait a minute until the room is cleared.")
        creature:teleportTo(fromPosition)
        return false
    end

    creature:teleportTo(info.teleportTo)
    local spectators = Game.getSpectators(info.center, false, false, 0, info.rangeX, 0, info.rangeY)
    if not filter(spectators, function(c) return c:isMonster() end, 1) then
        local boss = Game.createMonster(info.boss, info.center)
        if boss then
            boss:registerEvent('WarzoneBossDeath')
        end
    end

    return true
end
 
Solution
Back
Top