tarantonio
Old School Player
- Joined
- Jun 21, 2009
- Messages
- 865
- Solutions
- 1
- Reaction score
- 274
There is no working Bank NPC for TFS 1.0. I almost tried all bank npcs on this forum, but all have the same error, when you want to deposit money for example, and you say "yes" after" Are you sure to deposit X gold..." It does nothing.
This is the tricky part of the lua code:
The problem is located in this line:
In console it says: attempt to call global 'doPlayerDepositMoney' (a nil value)
This is the tricky part of the lua code:
Code:
--deposit
if talk_state[cid] == 20 and getCount(msg) > 0 then
talk_state[cid] = 21
last_count[cid] = getCount(msg)
sayText = 'Would you really like to deposit ' .. last_count[cid] .. ' gold coins?'
elseif talk_state[cid] == 20 and msgcontains(msg, 'all') then
if getPlayerMoney(cid) <= 0 then
talk_state[cid] = 0
sayText = 'You don\'t have any money.'
else
talk_state[cid] = 21
last_count[cid] = getPlayerMoney(cid)
sayText = 'Would you really like to deposit all your money, ' .. last_count[cid] .. ' gold coins?'
end
elseif talk_state[cid] == 21 and getCount(msg) <= 0 then
if msgcontains(msg, 'yes') then
if doPlayerDepositMoney(cid, last_count[cid]) == TRUE then
sayText = 'You deposited ' .. last_count[cid] .. ' gold coins. Now your account balance is ' .. getPlayerBalance(cid) .. ' gold coins.'
else
sayText = 'You don\'t have ' .. last_count[cid] .. ' gold coins.'
end
else
sayText = 'Well, can I help you with something else?'
end
talk_state[cid] = 0
end
The problem is located in this line:
Code:
if doPlayerDepositMoney(cid, last_count[cid]) == TRUE then
In console it says: attempt to call global 'doPlayerDepositMoney' (a nil value)
Last edited: