OldXar
Member
- Joined
- Feb 17, 2009
- Messages
- 215
- Reaction score
- 6
Heya all
There is something wrong with my promotion Npc...
When you ask for promotion he said if you want to get promoted etc..
But when you say 'yes' nothing happends and I'm getting an error in my console, I'm not very good with lua so I don't know how to fix it , anyone got a clue ?
promotion.lua
TFS 0.3
Kind regards,
Xar
There is something wrong with my promotion Npc...
When you ask for promotion he said if you want to get promoted etc..
But when you say 'yes' nothing happends and I'm getting an error in my console, I'm not very good with lua so I don't know how to fix it , anyone got a clue ?
[18/02/2009 23:50:31] data/npc/lib/npcsystem/modules.lua:79: attempt to compare nil with number
[18/02/2009 23:50:31] stack traceback:
[18/02/2009 23:50:31] data/npc/lib/npcsystem/modules.lua:79: in function 'callback'
[18/02/2009 23:50:31] data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[18/02/2009 23:50:31] data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
[18/02/2009 23:50:31] data/npc/lib/npcsystem/keywordhandler.lua:122: in function 'processMessage'
[18/02/2009 23:50:31] data/npc/lib/npcsystem/npchandler.lua:371: in function 'onCreatureSay'
[18/02/2009 23:50:31] data/npc/scripts/promotion.lua:7: in function <data/npc/scripts/promotion.lua:7>
promotion.lua
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, text = 'Congratulations! You are now promoted.'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
npcHandler:addModule(FocusModule:new())
TFS 0.3
Kind regards,
Xar