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

Svargrond arena script

Dorianek

Member
Joined
Nov 29, 2018
Messages
247
Reaction score
10
Location
Poland
C++:
Lua Script Error: [Action Interface]
data/actions/scripts/quests/svargrond arena/arenaDoor.lua:onUse
data/actions/scripts/quests/svargrond arena/arenaDoor.lua:13: attempt to index global 'storages' (a nil value)
stack traceback:
        [C]: in function '__index'
        data/actions/scripts/quests/svargrond arena/arenaDoor.lua:13: in function <data/actions/scripts/quests/svargrond arena/arenaDoor.lua:1>





arenaDoor.lua

C++:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    -- Cannot use opened door
    if item.itemid == 5133 then
        return false
    end

    if player:getStorageValue(Storage.SvargrondArena.Arena) < 1 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'This door seems to be sealed against unwanted intruders.')
        return true
    end

    -- Doors to rewards
    local cStorage = storages[item.actionid]
    if cStorage then
        if player:getStorageValue(cStorage) ~= 1 then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It\'s locked.')
            return true
        end

        item:transform(item.itemid + 1)
        player:teleportTo(toPosition, true)

    -- Arena entrance doors
    else
        if player:getStorageValue(Storage.SvargrondArena.Pit) ~= 1 then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'This door seems to be sealed against unwanted intruders.')
            return true
        end

        item:transform(item.itemid + 1)
        player:teleportTo(toPosition, true)
    end

    return true
end
 
storages is a nil value when defining cStorage variable, it should prolly be a global var.
 
Back
Top