QBCoreserver
Player.Functions.RemoveMoney
QBCore server documentation with a FiveM Lua example.
Summary
Removes money from a player's account. Returns false if they don't have enough — always check the return before granting whatever they paid for.
Returns
boolean — false if insufficient funds.
Parameters
moneytypestring'cash', 'bank', or 'crypto'.amountnumberThe amount to remove.reasonstringOptional reason for logs.Example
local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.RemoveMoney('cash', 100, 'shop-purchase') then
-- payment succeeded, give the item
else
-- not enough money
endCommon pitfalls
- ALWAYS branch on the return value — if it's false, don't give the reward.
- Do the charge and the reward in the same server-side flow to prevent exploits.
Related functions
Related guides
FiveM scripts done right
Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.
Browse Scripts →