Teddy
SweStream.se
Error :
Script's
[04/04/2009 14:54:51] Lua Script Error: [Npc interface]
[04/04/2009 14:54:51] data/npc/scripts/promotion.luanCreatureSay
[04/04/2009 14:54:51] data/npc/lib/npcsystem/modules.lua:80: attempt to compare nil with number
[04/04/2009 14:54:51] stack traceback:
[04/04/2009 14:54:51] data/npc/lib/npcsystem/modules.lua:80: in function 'callback'
[04/04/2009 14:54:51] data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[04/04/2009 14:54:51] data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
[04/04/2009 14:54:51] data/npc/lib/npcsystem/keywordhandler.lua:122: in function 'processMessage'
[04/04/2009 14:54:51] data/npc/lib/npcsystem/npchandler.lua:371: in function 'onCreatureSay'
[04/04/2009 14:54:51] data/npc/scripts/promotion.lua:7: in function <data/npc/scripts/promotion.lua:7>
Script's
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({'promot', 'promotion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can see that you are ready to get promoted, I will take a fee of 20.000 gold coins aswell, are you absolutely sure?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, text = 'Auhmm... Auhmm... Auhmm... Ahh... You are now ready.'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you are ready.', reset = true})
npcHandler:addModule(FocusModule:new())