Raggaer
Godly Member
Hello, Im very new to LUA and I was creating this simple NPC that sells first blessing but for some reason its not working, any help?
And the .xml file
PHP:
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({'blessing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the spiritual shielding blessing for 10000 gold?'})
node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 1, premium = true, cost = 10000, text = 'You are now blessed with spiritual shielding blessing.'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
npcHandler:addModule(FocusModule:new())
And the .xml file
Code:
<npc name="Norf" script="Norf.lua" autowalk="1" floorchange="0">
<health now="100" max="100"/>
<look type="57" head="110" body="69" legs="41" feet="91" corpse="2212"/>
</npc>