• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

NPC that will loose focus by a keyword differrent than 'bye'

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: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({'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.
 
Back
Top