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

Help with npc

labbadia

New Member
Joined
Aug 29, 2010
Messages
51
Reaction score
1
Hello guys,
i want to make one npc "Help" to my server for help the newbies.
He will stay in temple and when you say hi, he will say, Hello to server ...bla bla bla bla...if u want to know more of informations just say that : {exp} , {skills} {depot} {bank} ...etc
when guy say exp per example the npc will say the exp rate is 100x...
if possible i want to when the guy say depot ...the npc say the depot is north east from here...do u want teleport?
How can i do one npc with that fucntions?
Thanks
Obs: i can edit the npc ( just need the script with that options , dont know how to work that system to say one word and he say informations)
 
sRIPTS

This works for me! (tp script idk xD)

in .xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Help" script="data/npc/scripts/help.lua" walkinterval="0" floorchange="0">
	<health now="150" max="150"/>
	<look type="139" head="20" body="39" legs="45" feet="7" corpse="2212"/>
	<parameters>
		<parameter key="module_shop" value="1"/>
		<parameter key="message_greet" value="Hello |PLAYERNAME|.Just say {help}."/>
</parameters>
</npc>

In .lua
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState= {}

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

function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

--------------------MESSAGES------------------------------------------------------------------------------
    if msgcontains(msg, 'Help') or msgcontains(msg, 'Help') then
                selfSay('I can tell you something about {rates} {depot} {bank} {addons} {Own thing}', cid)
        
        elseif msgcontains(msg, 'rates') then
        selfSay('The Rates are.....', cid)
    
    elseif msgcontains(msg, 'depot') then
        selfSay('The depot is north east from here', cid)

    elseif msgcontains(msg, 'bank') then
        selfSay('Bank.......', cid)
                
    elseif msgcontains(msg, 'addons') then
        selfSay('We are using real tibia addon system.', cid)
        
        elseif msgcontains(msg, 'infernal bolt') then
                selfSay('Something else:D?', cid)

        end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


Yours Kaspertje100! some rep is always nice:)
 
Back
Top