É o seguinte, no meu OT ja veio com esse script do NPC Banker, mais ele ta com um erro, eu não axei erro no script, mais não sei o que está acontecendo.
EU: Hi
Banker: Welcome [VIP] [GOD] Pedro! Here, you can deposit, withdraw or transfer your money from your bank account. I can change your coins too.
EU: deposit all
Banker: Would you really like to deposit 940000 gold?
EU: yes
Banker: You do not have enough gold.
não sei por que ta acontecendo isso não da pra depositar nada
eu procurei aqui no forum e não axei ninguem com o mesmo problema então
alguem pode me ajudar?
Código do script:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local moneyTo = {}
local playerTo = {}
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 isValidMoney(money)
if isNumber(money) == TRUE and money > 0 and money < 999999999 then
return TRUE
end
return FALSE
end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'help') or msgcontains(msg, 'offer') then
selfSay("You can check the {balance} of your bank account, {deposit} money or {withdraw} it. You can also {transfer} money to other characters, provided that they have a vocation.", cid)
selfSay('You can check the {balance{ of your bank account, Pdeposit{ money or Pwithdraw{ it. You can also {transfer} money to othercharacters, provided that they have a vocation.', cid)
talkState[cid] = 0
elseif msgcontains(msg, 'advanced functions') then
selfSay('Renting a house has never been this easy. Simply make a bid for an auction. We will check immediately if you haveenough money.', cid)
selfSay('You don\'t have any money to deposit in you inventory..', cid)
talkState[cid] = 0
else
selfSay('Would you really like to deposit '..moneyTo[cid]..' gold?', cid)
talkState[cid] = 2
end
elseif msgcontains(msg, 'deposit') then
selfSay("Please tell me how much gold it is you would like to deposit.", cid)
talkState[cid] = 1
elseif talkState[cid] == 1 then
moneyTo[cid] = tonumber(msg)
if isValidMoney(moneyTo[cid]) == TRUE then
selfSay('Would you really like to deposit '..moneyTo[cid]..' gold?', cid)
talkState[cid] = 2
else
selfSay('Is isnt valid amount of gold to deposit.', cid)
talkState[cid] = 0
end
elseif talkState[cid] == 2 then
if msgcontains(msg, 'yes') then
if doPlayerDepositMoney(cid, moneyTo[cid], 1) ~= TRUE then
selfSay('You do not have enough gold.', cid)
else
selfSay('Alright, we have added the amount of '..moneyTo[cid]..' gold to your balance. You can withdraw your money anytime you want to. Your account balance is ' .. getPlayerBalance(cid) .. '.', cid)
end
elseif msgcontains(msg, 'no') then
selfSay('As you wish. Is there something else I can do for you?', cid)
selfSay("Please tell me how much gold you would like to withdraw.", cid)
talkState[cid] = 6
elseif talkState[cid] == 6 then
moneyTo[cid] = tonumber(msg)
if isValidMoney(moneyTo[cid]) == TRUE then
selfSay('Are you sure you wish to withdraw '..moneyTo[cid]..' gold from your bank account?', cid)
talkState[cid] = 7
else
selfSay('Is isnt valid amount of gold to withdraw.', cid)
talkState[cid] = 0
end
elseif talkState[cid] == 7 then
if msgcontains(msg, 'yes') then
if doPlayerWithdrawMoney(cid, moneyTo[cid]) ~= TRUE then
selfSay('There is not enough gold on your account. Your account balance is '..getPlayerBalance(cid)..'. Please tell me the amount of gold coins you would like to withdraw.', cid)
else
selfSay('Here you are, ' .. moneyTo[cid] .. ' gold. Please let me know if there is something else I can do for you.', cid)
talkState[cid] = 0
end
elseif msgcontains(msg, 'no') then
selfSay('As you wish. Is there something else I can do for you?', cid)
info
Grupo: Campones
Registrado: 11/10/08
Posts: 47
Reputação: +5
Char no Tibia: Pedrosdtacador de runa
É o seguinte, no meu OT ja veio com esse script do NPC Banker, mais ele ta com um erro, eu não axei erro no script, mais não sei o que está acontecendo.
não sei por que ta acontecendo isso não da pra depositar nada
eu procurei aqui no forum e não axei ninguem com o mesmo problema então
alguem pode me ajudar?
Código do script: