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

Bring me to / instant buy bp tfs 1.2 8.0

jurasski

New Member
Joined
Nov 20, 2020
Messages
17
Reaction score
3
TFS 1.2 8.0 version celohere

i search script for NPC Boat,
example - bring me to carlin
and
For magic shop NPC
example.- instant buy bp mana fluid
 
Here is working solution for instant travel 'bring me to ..' npc script.


NPC .lua script looks like that: (just enter your data and it should work)

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


local function Cptl(f, r)
     return f:upper()..r:lower()
end

function creatureSayCallback(cid, type, msg)       
     local player, cmsg = Player(cid), msg:gsub("(%a)([%w_']*)", Cptl)
     if not npcHandler:isFocused(cid) then
         if msg == "bring me to jungle" then                            -- here use your own formula
             npcHandler:addFocus(cid)
            local jngl =  {x=306, y=34, z=7}                            -- set proper location coords and name
            local playerpos = player:getPosition()
                if (doPlayerRemoveMoney(cid, 320) == TRUE) then            -- set instant travel cost
                    doTeleportThing(cid,jngl)                            -- change 'jngl' name if needed
                    doSendMagicEffect(playerpos,3)
                    doSendMagicEffect(jngl,11)                            -- change 'jngl' name if needed
                else
                    selfSay('Not enough gold.')
                    npcHandler:releaseFocus(cid)
                end
        elseif msg == "bring me to loren" then
             npcHandler:addFocus(cid)
            local lor =  {x=15, y=454, z=7}
            local playerpos = player:getPosition()
                if (doPlayerRemoveMoney(cid, 260) == TRUE) then
                    doTeleportThing(cid,lor)
                    doSendMagicEffect(playerpos,3)
                    doSendMagicEffect(lor,11)
                else
                    selfSay('Not enough gold.')
                    npcHandler:releaseFocus(cid)
                end
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top