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

Solved TFS 1.X PROBLEM STORAGE WHAT A FOOLISH QUEST

GOD Bon

New Member
Joined
Jul 18, 2011
Messages
7
Reaction score
0
Hello, Guys

I have problem to use NPCs for mission 10 of What Foolish Quest.

When i saying in The NPC "Avar Tar" or another NPC of this quest the word "cookie" and after saying "yes" the console show this error.

See the erro bellow!

Code:
Lua Script Error: [Npc interface]
data/npc/scripts/Avar Tar.lua:onCreatureSay
data/lib/core/player.lua:99: attempt to index global 'STORAGE' (a nil value)
stack traceback:
        [C]: in function '__index'
        data/lib/core/player.lua:99: in function 'getCookiesDelivered'
        data/npc/scripts/Avar Tar.lua:46: in function 'callback'
        data/npc/lib/npcsystem/npchandler.lua:431: in function 'onCreatureSay'
        data/npc/scripts/Avar Tar.lua:7: in function <data/npc/scripts/Avar Tar.lua:7>

When i commented this line
Code:
if player:getCookiesDelivered() == 10 then
         player:addAchievement('Allow Cookies?')
end

The error disappeared in the console and executed rest of code correctly

The class inherited have this function
Code:
function Player.getCookiesDelivered(self)
    local storage, amount = {
        STORAGE.WHATAFOOLISHQUEST.COOKIEDELIVERY.SIMONTHEBEGGAR, STORAGE.WHATAFOOLISHQUEST.COOKIEDELIVERY.MARKWIN, STORAGE.WHATAFOOLISHQUEST.COOKIEDELIVERY.ARIELLA,
        STORAGE.WHATAFOOLISHQUEST.COOKIEDELIVERY.HAIRYCLES, STORAGE.WHATAFOOLISHQUEST.COOKIEDELIVERY.DJINN, STORAGE.WHATAFOOLISHQUEST.COOKIEDELIVERY.AVARTAR,
        STORAGE.WHATAFOOLISHQUEST.COOKIEDELIVERY.ORCKING, STORAGE.WHATAFOOLISHQUEST.COOKIEDELIVERY.LORBAS, STORAGE.WHATAFOOLISHQUEST.COOKIEDELIVERY.WYDA,
        STORAGE.WHATAFOOLISHQUEST.COOKIEDELIVERY.HJAERN
    }, 0
    for i = 1, #storage do
        if self:getStorageValue(storage[i]) == 1 then
            amount = amount + 1
        end
    end
    return amount
end

Someone can help me this problem?

Thanks!
 
everything is in caps
if you're using orts it should be Storage not STORAGE
check your storage.lua in your lib
 
Solution
Back
Top