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

Svarground Arena tfs 1.2

zxzxzx

New Member
Joined
Mar 12, 2011
Messages
334
Reaction score
3
Hello! In my script from tfs 10.90 1.2 I have this error from arena door.lua : 2 attempt to idex global 'storage' (a nil value) CJ in function '__index' lua2 in main chunk how to make this works?

code:
Code:
local storages = {
    [26100] = Storage.SvargrondArena.Greenhorn,
    [27100] = Storage.SvargrondArena.Scrapper,
    [28100] = Storage.SvargrondArena.Warlord
}

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
 
your error seems to be trying to fetch
Storage.SvargrondArena.Greenhorn
where is that table located?
located in
Code:
\actions\scripts\quests\svargrond arena
- script

action xml
Code:
    <!-- Arena Quest-->
    <action actionid="13100" script="quests/svargrond arena/arena_door.lua" />
    <action actionid="26100" script="quests/svargrond arena/arena_door.lua" />
    <action actionid="27100" script="quests/svargrond arena/arena_door.lua" />
    <action actionid="28100" script="quests/svargrond arena/arena_door.lua" />

action id 26100 is on the doors.
 
Back
Top