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

Solved NPC Banker Not To Transfer to a No Vocation Player

dkangel83

Member
Joined
Mar 31, 2010
Messages
148
Reaction score
18
Location
Brazil
Hi im using the npc banker made by gesior in a post about house auction but i'd like to set it to not transfer if the target player have no vocation..

I asked in a brazillian forum for a help and a guy did with a change it gives me an error.. so.. is there anyone able to make it work to me?

Im using TFS 1.2

Code:
Lua Script Error: [Npc interface]
data/npc/scripts/banker.lua:onCreatureSay
data/npc/scripts/banker.lua:191: attempt to index local 'target' (a nil value)
stack traceback:
        [C]: in function '__index'
        data/npc/scripts/banker.lua:191: in function 'callback'
        data/npc/lib/npcsystem/npchandler.lua:407: in function 'onCreatureSay'
        data/npc/scripts/banker.lua:9: in function <data/npc/scripts/banker.lua:9>


Code:
if getPlayerBalance(cid) - getPlayerBiddedMoney(cid) >= count[cid] then
                if v or findPlayer(msg):lower() == msg:lower() then
                    local target = getPlayerName(v)
                    if target:getVocation() ~= 0 then
                        transfer[cid] = msg
                        npcHandler:say('Would you really like to transfer ' .. count[cid] .. ' gold to ' .. getPlayerName(v) .. '?', cid)
                        Topic[cid] = 7
                    else
                        npcHandler:say('You cannot transfer money to rook citizen.', cid)
                        Topic[cid] = 5
                    end
                else
                    npcHandler:say('This player does not exist.', cid)
                    Topic[cid] = nil
                end
            else
                npcHandler:say('There is not enough gold on your account.', cid)
                Topic[cid] = nil
            end
 
no problem :) have fun bro hope you like :)

I do, its working with no problem... im making some more tests with, but till now its ok.. i shared your answer with the bug free code in the brazilian forum where i made the 1st post asking help, to show them the code fixed, hope have no problem about doing it.

Once again, thanks for saving me :)
 
Back
Top