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

Boat Travel

Status
Not open for further replies.

Akkz

New Member
Joined
Apr 22, 2012
Messages
172
Reaction score
0
How do I make so I can go from Thais to zao? I have paste position and everything but it wont work, help anyone?!
 
Try this:

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({'city 1'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to City 1 for 120 gold coins?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 120, destination = {x=, y=, z=} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local travelNode = keywordHandler:addKeyword({'city 2'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to city 2 for 400 gold coins?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 400, destination = {x=, y=, z=} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \{City 1\}, \{City 2\} for just a small fee.'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

Just change the name of the cities and the positions.

Source: http://otland.net/f16/boat-npc-140212/#post1350763
 
what is this? :O in console
Code:
[Error - Npc interface]
data/npc/scripts/TP/boat_liberty.lua:onCreatureSay
Description:
data/npc/lib/npcsystem/npchandler.lua:301: bad argument #1 to 'gsub' (string expected, got nil)
stack traceback:
        [C]: in function 'gsub'
        data/npc/lib/npcsystem/npchandler.lua:301: in function 'parseMessage'
        data/npc/lib/npcsystem/modules.lua:55: in function 'callback'
        data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
        data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
        data/npc/lib/npcsystem/keywordhandler.lua:122: in function 'processMessage'
        data/npc/lib/npcsystem/npchandler.lua:380: in function 'onCreatureSay'
        data/npc/scripts/TP/boat_liberty.lua:10: in function <data/npc/scripts/TP/boat_liberty.lua:1
0>
 
what is this? :O in console
Code:
[Error - Npc interface]
data/npc/scripts/TP/boat_liberty.lua:onCreatureSay
Description:
data/npc/lib/npcsystem/npchandler.lua:301: bad argument #1 to 'gsub' (string expected, got nil)
stack traceback:
        [C]: in function 'gsub'
        data/npc/lib/npcsystem/npchandler.lua:301: in function 'parseMessage'
        data/npc/lib/npcsystem/modules.lua:55: in function 'callback'
        data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
        data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
        data/npc/lib/npcsystem/keywordhandler.lua:122: in function 'processMessage'
        data/npc/lib/npcsystem/npchandler.lua:380: in function 'onCreatureSay'
        data/npc/scripts/TP/boat_liberty.lua:10: in function <data/npc/scripts/TP/boat_liberty.lua:1
0>

Change your npcsystem (data/npc/lib/npcsytem), all the folder to new one
 
I don't understand why you made a new thread about the same problem.

Either way, I'm going to close this one.
 
Status
Not open for further replies.
Back
Top