• 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

hioad

New Member
Joined
Feb 28, 2010
Messages
157
Reaction score
0
Hi, when 2 players msgs the npc togather then the npc don't work right.

Ex:

Player1:Hi, svargrond , yes. the npc tps him to the right place (svargrond)


Player2:Hi, svargrond , yes. The npc tps him 2 edron

This happens only when 2 players msg the npc at the same time

Help please :)

And thanks
 
Just edit this script for your preferences:

PHP:
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({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want go to Svargrond ?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 1, premium = true, cost = ???, destination = {x=???, y=???, z=?} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Ok, than...'})
        
        keywordHandler:addKeyword({'Offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Svargrond'})
        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())
 
Back
Top