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

[problem]with boat npc

Mikuch

/home/mikuch
Joined
Jul 1, 2008
Messages
440
Reaction score
1
Location
Poland/Kielce
Hello
I made new vocations and wanna only them to be to swim on new island is there anyway to do this

I`m using that npc boat system TFS 2.0.12



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({'premy island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do You rly want to traven to Gernia for 100 gp?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=436, y=624, z=6} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'So dont disturb me!'})      

        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())
 
in creatureSayCallback
Code:
local town = { x = x, y = y, z = z }
if msgcontains(msg, 'town') then
    if isPremium(cid) == TRUE then
        if getCreatureCondition(cid, CONDITION_IN_FIGHT) == FALSE then
            if doPlayerRemoveMoney(cid, money) == TRUE then
                if isInArray({voc,voc}, getPlayerVocation(cid) == TRUE then
                    selfSay("Set the sails!")
                    doTeleportThing(cid, town, 0)
                else
                    selfSay("Sorry, only some vocations may use my ship!")
                end
            else
                selfSay("You do not have enough money")
        else
            selfSay("No blood on my ship!")
        end
    else
        selfSay("Only premium players are allowed to use my ship.")
    end
end
 
CAn u show where to paste it:? I need npc that is teleporting people with pacc but its not working If I change premium = true


edit: ops srry its working, srry for spam
 
Last edited:

Similar threads

Back
Top