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

B

Boy67

Guest
knowing me, i am not the best at npc's, i absolutely hate the system and in fact, i cant even script a npc probably anyone else could.

So if i can have some help, would anybody be bale to create a script like this.

Hi Message =
Code:
'Hello ' .. getCreatureName .. ', would you like some help to get to Orcan Island?'
Bye message =
Code:
'Ok Bye'

person = Hi or Hello
npc = "Hi Message"
person = Orcan Island
npc = "Are you sure, this will cost you 500gp?"
person = yes(remove 500gp, person gets teleported to a certain distination)
Can someone make this script for me please.
 
I can help you make this later on. I just need to finish another script right now, but if someone else helps you before I do it'd be great.

EDIT: Aeh wth, this will just take like 4 mins to make, what's the coordinates for where you'd like to get teleported?
 
Last edited:
Just change the posx, posy and posz on the Npc.xml to the "orcan island" cordinates.

Npc.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Npc Name" script="data/npc/scripts/travel.lua" autowalk="1" floorchange="0">
    <health now="150" max="150"/>
    <look type="143" head="0" body="45" legs="40" feet="116" corpse="2212"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. Would you like some help to get to Orcan Island?"/>
        <parameter key="module_travel" value="1" />
        <parameter key="travel_destinations" value="orcan island, [B]posx[/B], [B]posy[/B], [B]posz[/B], 500;" />
        <parameter key="message_farewell" value="Ok, bye." />
    </parameters>
</npc>
travel.lua
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

npcHandler:addModule(FocusModule:new())
 
Last edited:
Thanks so much nightmare :). It works perfect

@Empty: Thank you anyway, i didnt expect anyone to respond that quick, at Ot_Fans ,no one helps, they say thats one of the most active boards, it really isnt.
 
Back
Top