• 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!

Lua Help with NPC Keywords!

Kayan

Active Member
Joined
Sep 19, 2007
Messages
1,561
Reaction score
38
Location
Santa Catarina
Lua:
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 travelNodeVengoth = keywordHandler:addKeyword({'back'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu posso te mandar de volta para o {trade quarter} por 50 moedas. Aceita?'})
local travelNodeVengoth = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu posso te mandar de volta para o {trade quarter} por 50 moedas. Aceita?'})
local travelNodeVengoth = keywordHandler:addKeyword({'trade quarter'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu posso te mandar de volta para o {trade quarter} por 50 moedas. Aceita?'})
local travelNodeVengoth = keywordHandler:addKeyword({'passage'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu posso te mandar de volta para o {trade quarter} por 50 moedas. Aceita?'})


travelNodeVengoth:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 50, destination = {x=32837, y=31365, z=7}, msg = 'Okay. Enjoy!' })
travelNodeVengoth:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Come back anytime.'})

npcHandler:addModule(FocusModule:new())

Why this npc doens't work? I dont want repeat, in all node yes and no. I need a short script!
 
Back
Top