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!
When i commented this line
The error disappeared in the console and executed rest of code correctly
The class inherited have this function
Someone can help me this problem?
Thanks!
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!