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

Boat npc gets money from bank with storage

lucastiond

New Member
Joined
Jul 14, 2013
Messages
35
Reaction score
0
Hello guys

As the title explain, I really don't know how to make the boat npc travels the player when he has a certain storage and gets the money from his bank account, as the usual "travelKeyword" works.

Thanks!
 
UP

As I didn't explained very well what I want to know, I will do it now.
My regular boat npc is able to get the money of the trip from my bank account, because of the npc module.

But what I don't know how to do is to make the npc of the boat get the money from my account, as the others do, but only takes you if you have a storage.
My npc script is like this:

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

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

    if(msgcontains(msg, "vengoth")) then
            npcHandler:say("So you are saying you're looking for someone to take you to Vengoth?", cid)
            npcHandler.topic[cid] = 1
            end
    if msgcontains(msg, "blood crystal") then
        npcHandler:say("What the heck, stop bothering me with your questions.", cid)
            npcHandler.topic[cid] = 0
        
    elseif (msgcontains(msg, "yes")) then
        if npcHandler.topic[cid] == 1 and player:getStorageValue(Storage.BloodBrothersQuest.Mission04) >= 1 then
        npcHandler:say("I could do that, it's not far from here. I don't run a charity organisation, though. Tell you what. Give me 100 gold pieces, and me and my boat are yours for the trip. Okay?", cid)
        npcHandler.topic[cid] = 2
        elseif npcHandler.topic[cid] == 2 and player:getMoney() >= 100 then
        player:removeMoney(100)
        npcHandler:say("Okay. Enjoy.", cid)
        doTeleportThing(cid, {x = 32858, y = 31549, z = 7})
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        npcHandler.topic[cid] = 0
        elseif npcHandler.topic[cid] == 2 and player:getMoney() < 100 then
        npcHandler:say("You don't have enough money.", cid)
        npcHandler.topic[cid] = 0
        elseif npcHandler.topic[cid] == 1 and player:getStorageValue(Storage.BloodBrothersQuest.Mission04) < 1 then
        npcHandler:say("Sorry, but you are not allowed to go there.", cid)
        npcHandler.topic[cid] = 0

end
end

return true
end       
    
    
npcHandler:setMessage(MESSAGE_FAREWELL, "Bye!")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Fine then.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


As you can see, he only gets the money from the players backpack.

Thanks
 
You'll have to check your bank npc, or another npc on how it checks for money in the bank, and how it withdraws money from the bank.
Then just make it check like that in the boat npc.
 
Back
Top