CristianXtreme
Active Member
- Joined
- Apr 14, 2016
- Messages
- 76
- Reaction score
- 45
Hi guys! I've been trying to make the NPC answer me but there is no way to make it answer... I'm new at NPC creating! (I'm sorry)
He don't react to "hi" or "bye" it don't react to the words of the script (like "travel")
This is the NPC File :
This is the NPC script :
Any one can help me?
PD: There are not any errors on the console... And the NPC says : "Good bye." when you walk far away from him
He don't react to "hi" or "bye" it don't react to the words of the script (like "travel")
This is the NPC File :
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Master Roshi" script="roshi.lua" walkinterval="0" access="5" floorchange="0">
<health now="150" max="150"/>
<look type="66" />
<parameters>
<parameter key="message_farewell" value="Farewell |PLAYERNAME|!" />
</parameters>
</npc>
This is the NPC script :
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'Kame House'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to travel to Kame House?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=1367, y=403, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})
local travelNode = keywordHandler:addKeyword({'Namek'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Namek?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=967, y=247, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Kame House or Namek!'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
Any one can help me?
PD: There are not any errors on the console... And the NPC says : "Good bye." when you walk far away from him