I have promotion npc but it is buged can somebody help me?
Bug:
Bug:
Code:
[13/12/2008 14:44:23] Lua Script Error: [Npc interface]
[13/12/2008 14:44:23] data/npc/scripts/promotion2.lua
[13/12/2008 14:44:23] luaGetPlayerStorageValue(). Player not found
Code:
[13/12/2008 14:44:23] Lua Script Error: [Npc interface]
[13/12/2008 14:44:23] data/npc/scripts/promotion2.lua
[13/12/2008 14:44:23] data/npc/lib/npcsystem/npchandler.lua:576: table index is nil
[13/12/2008 14:44:23] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/promotion2.lua
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local node1 = keywordHandler:addKeyword({'destiny'})
if (getPlayerStorageValue(cid, 42355) == 3) and (getPlayerStorageValue(cid, 7416) == 2) then
npcHandler:say("You made arena quest and defeat undead dragon. I can show you your destiny if you want, only for 200k.", cid)
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now ' .. getPlayerPromotionLevel(cid) .. '.'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
else
npcHandler:say("Sorry, but I do not remember you...", cid)
end
npcHandler:addModule(FocusModule:new())