• 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

Ward_214

Pro PvP
Joined
Dec 11, 2008
Messages
297
Reaction score
0
I need an NPC that I can change the name or whatever...
I want to be able to say "Hi" "Travel wherever" and you pop up where you have the x,y,z pos set. Can someone make this for me? ^_^
 
I need an NPC that I can change the name or whatever...
I want to be able to say "Hi" "Travel wherever" and you pop up where you have the x,y,z pos set. Can someone make this for me? ^_^


this? u can change the city name and pos waht ever u want :P:P..

Captain Max.xml

data\npc

Code:
<?xml version="1.0" encoding="UTF-8"?> 
<npc name="[B]Captain Max[/B]" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0"> 
<health now="100" max="100"/> 
<look type="134" head="95" body="10" legs="56" feet="77" addons="0"/> 
	<parameters>
		    <parameter key="message_greet" value="Hello |PLAYERNAME|.Where do you want sail. I can take you to [B]OtLand[/B]." />
		<parameter key="module_keywords" value="1" />
		<parameter key="keywords" value="[B]travel[/B];help;prem" />
		<parameter key="keyword_reply1" value="I can take you to [B]OtLand[/B]." />
		<parameter key="keyword_reply2" value="I can ofcourse help you travel, if you have money." />
	</parameters>
</npc>

\data\npc\scripts

boat.lua

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({'[B]yalahar[/B]'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to [B]Yalahar[/B] for 400 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 400, destination = [COLOR="Red"][B]{x=9798, y=9785, z=6}[/B][/COLOR] })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
                
        keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to [B]Yalahar[/B].'})
        keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
        keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to [B]Yalahar[/B].'})
        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())


hope it helped u =)
 
[11/04/2009 22:19:01] Lua Script Error: [Npc interface]
[11/04/2009 22:19:01] data\npc\scripts\travel.lua

[11/04/2009 22:19:01] data\npc\scripts\travel.lua:12: attempt to index global 'keywordHandler' (a nil value)
[11/04/2009 22:19:01] [Warning - NpcScript::NpcScript] Can not load script: data\npc\scripts\travel.lua


[11/04/2009 22:19:01] Lua Script Error: [Npc interface]
[11/04/2009 22:19:01] data\npc\scripts\travel.lua

[11/04/2009 22:19:01] data\npc\scripts\travel.lua:12: attempt to index global 'keywordHandler' (a nil value)
[11/04/2009 22:19:01] [Warning - NpcScript::NpcScript] Can not load script: data\npc\scripts\travel.lua




I get that error, wtf?
 
[11/04/2009 22:19:01] Lua Script Error: [Npc interface]
[11/04/2009 22:19:01] data\npc\scripts\travel.lua

[11/04/2009 22:19:01] data\npc\scripts\travel.lua:12: attempt to index global 'keywordHandler' (a nil value)
[11/04/2009 22:19:01] [Warning - NpcScript::NpcScript] Can not load script: data\npc\scripts\travel.lua


[11/04/2009 22:19:01] Lua Script Error: [Npc interface]
[11/04/2009 22:19:01] data\npc\scripts\travel.lua

[11/04/2009 22:19:01] data\npc\scripts\travel.lua:12: attempt to index global 'keywordHandler' (a nil value)
[11/04/2009 22:19:01] [Warning - NpcScript::NpcScript] Can not load script: data\npc\scripts\travel.lua




I get that error, wtf?

um waht on tfs version u use?
 
Back
Top