The money account is nil
A script asked for a money account that this player does not have, usually because the account name does not match your framework.
Do this first
Report it to whoever made the script, with the name of your framework.
What it means
A money operation asked for an account the player does not have. ESX exposes xPlayer.getAccount('bank'), QBCore uses PlayerData.money['bank']; either returns nil for an account name that is not configured.
Getting this wrong is worth care: money code that silently does nothing is how duplication bugs and missing paychecks happen.
What causes it
Ordered by how often it is the answer.
- 1
An account name that does not exist
'money'vs'cash'vs'bank'vs'black_money'differ between frameworks and versions. The name is a string, so nothing checks it. - 2
The accounts row was never created
A character created before that account type existed.
- 3
Read before the player loaded
Same timing problem as everything else on the client.
- 4
A custom account added to the config but not to existing players
New accounts do not backfill.
How to tell which one is yours
Print what the player actually has:
-- ESX print(json.encode(xPlayer.getAccounts())) -- QBCore print(json.encode(Player.PlayerData.money))
The list of real names ends the guessing.
Where to look
The account name in the call, against the framework's configured accounts.
How to fix it
Check the account before touching it, and do money on the SERVER only:
-- ESX
local account = xPlayer.getAccount('bank')
if not account then return end
if account.money < price then return end
xPlayer.removeAccountMoney('bank', price)
-- QBCore
if not Player.Functions.RemoveMoney('bank', price) then return endBoth RemoveMoney and removeAccountMoney can fail — check the result rather than assuming it worked.
Still stuck on your own code?
This page is what this error usually means. Paste your console into Server Fixer and it will rank everything in it and tell you what to do first, and if you would rather not touch it, ORBIE can repair the script and hand the resource back ready to drop in.
bug_reportOpen Server Fixer