Hiho Guy's.. I have a problem with my Blessing Npc
I use TFS 0.3.3
Npc problem...
/data/npc/AliceBlessing.xml
data/npc/scripts/AliceBlessings.lua
can someone help me?
I use TFS 0.3.3
Npc problem...
Code:
[26/04/2009 09:00:12] Lua Script Error: [Npc interface]
[26/04/2009 09:00:12] data/npc/scripts/AliceBlessings.lua:onCreatureSay
[26/04/2009 09:00:12] data/npc/lib/npcsystem/modules.lua:141: attempt to compare nil with number
[26/04/2009 09:00:12] stack traceback:
[26/04/2009 09:00:12] data/npc/lib/npcsystem/modules.lua:141: in function 'callback'
[26/04/2009 09:00:12] data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[26/04/2009 09:00:12] data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
[26/04/2009 09:00:12] data/npc/lib/npcsystem/keywordhandler.lua:122: in function 'processMessage'
[26/04/2009 09:00:12] data/npc/lib/npcsystem/npchandler.lua:381: in function 'onCreatureSay'
[26/04/2009 09:00:12] data/npc/scripts/AliceBlessings.lua:8: in function <data/npc/scripts/AliceBlessings.lua:8>
/data/npc/AliceBlessing.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Alice Blessings" script="data/npc/scripts/AliceBlessings.lua" walkinterval="2000" speed="1" floorchange="1" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="138" head="55" body="68" legs="96" feet="32" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Hello, |PLAYERNAME|. I sell 'first', 'second', 'third', 'fourth' and 'fifth' bless for 10.000 gold coins each." />
</parameters>
</npc>
data/npc/scripts/AliceBlessings.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({'first bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first blessing for 10000 gold?'})
node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 1, premium = false, cost = 10000})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node2 = keywordHandler:addKeyword({'second bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the second blessing for 10000 gold?'})
node2:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 2, premium = false, cost = 10000})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node3 = keywordHandler:addKeyword({'third bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the third blessing for 10000 gold?'})
node3:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 3, premium = false, cost = 10000})
node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node4 = keywordHandler:addKeyword({'fourth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fourth blessing for 10000 gold?'})
node4:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 4, premium = false, cost = 10000})
node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node5 = keywordHandler:addKeyword({'fifth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fifth blessing for 10000 gold?'})
node5:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 5, premium = false, cost = 10000})
node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node6 = keywordHandler:addKeyword({'all bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fifth blessing for 50000 gold?'})
node6:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 5, bless = 1, bless = 4, bless = 3, bless = 2, premium = false, cost = 50000})
node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
npcHandler:addModule(FocusModule:new())
can someone help me?