Slime
Active Member
- Joined
- Jan 25, 2014
- Messages
- 115
- Reaction score
- 33
I need help with a simple script - npc will just loose focus after player's answer.
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler
nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler
nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler
nCreatureSay(cid, type, msg) end
function onThink() npcHandler
nThink() end
local node1 = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = false, text = 'That which you see rising up on that island is the Tower of Najima.'})
*****(here I want npc to loose focus on a player, so you will have to say hi again to talk to him)****
local node2 = keywordHandler:addKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = false, text = 'You should see it as soon as you go outside.'})
*****(and same here, if the player says no, the npc says the message and looses focus on a player)*****
npcHandler:addModule(FocusModule:new())
I guess it has something to do with "module.npcHandler:releaseFocus(cid)" but I have no idea how to use it.
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler
function onCreatureDisappear(cid) npcHandler
function onCreatureSay(cid, type, msg) npcHandler
function onThink() npcHandler
local node1 = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = false, text = 'That which you see rising up on that island is the Tower of Najima.'})
*****(here I want npc to loose focus on a player, so you will have to say hi again to talk to him)****
local node2 = keywordHandler:addKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = false, text = 'You should see it as soon as you go outside.'})
*****(and same here, if the player says no, the npc says the message and looses focus on a player)*****
npcHandler:addModule(FocusModule:new())
I guess it has something to do with "module.npcHandler:releaseFocus(cid)" but I have no idea how to use it.