• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Travel NPC

ZeeBeast

Preferable Beta Tester
Joined
Dec 5, 2013
Messages
206
Reaction score
10
Location
United States
Hello guys. I am having a little difficulty with traveling by boat.
This is what I have for the xml version but I'm not sure if it is right.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Hopps" script="default.lua" walkinterval="4000" floorchange="0">
    <health now="150" max="150"/>
    <look type="129" head="114" body="119" legs="114" feet="114" corpse="2212"/>
    <parameters>
        <parameter key="module_travel" value="1"/>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. If you don't know where to flow, say {travel}."/>
        <parameter key="travel_destinations" value="Grasslands,1073,1256,7,5000;"/>
    </parameters>
</npc>
And when I try to talk to the NPC, it is kind of like this.
23:27 Captain Hopps: Hello Admin. If you don't know where to flow, say travel.
23:27 Admin [1]: travel
23:27 Captain Hopps: Grasslands.
23:27 Admin [1]: Grasslands
And then nothing happens and the NPC does not say anything else.
Someone please help.
 
I know why script sucks I know how to fix :)) REP+++ PLS

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Nimral" script="travelpanamera.lua" walkinterval="2000" floorchange="0">
    <health now="150" max="150"/>
    <look type="367" head="114" body="114" legs="0" feet="114" addons="0" corpse="2212"/>
    <parameters>
        <parameter key="module_travel" value="1"/>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. If you don't know where to flow, say {travel}."/>
    </parameters>
</npc>

Code:
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


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'tyrush'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Tyrush?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=3334, y=3451, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You gettin\' sea sick, eh?'})
local travelNode = keywordHandler:addKeyword({'gengia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Gengia?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=2080, y=3527, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You gettin\' sea sick, eh?'})
local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Yalahar?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=784, y=2041, z=5} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You gettin\' sea sick, eh?'})

keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Tyrush\', \'Gengia\', \'Yalahar\' for free.'})


npcHandler:addModule(FocusModule:new())
 
Ray Rewind, your script works great, but i have a problem with the npc. He doesnt recognices my custom town names as keywords to trigger the teleportation. What and where i need to add the town names so that he can recognize them and teleport me. If anyone else knows answer it would be much appreciated
 
Ray Rewind, your script works great, but i have a problem with the npc. He doesnt recognices my custom town names as keywords to trigger the teleportation. What and where i need to add the town names so that he can recognize them and teleport me. If anyone else knows answer it would be much appreciated

Change this
local travelNode = keywordHandler:addKeyword({'yalahar'},
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Tyrush\', \'Gengia\', \'Yalahar\' for free.'})
 
I changed Yalahar for Lucera (one custom town), and i changed it on both places and when i say "Lucera" to npc he doesnt react. I dont get an error either, it just doesnt react to the word.
 
Back
Top