ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
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 it before giving the reward.

Returns

boolean — false if insufficient funds.

Parameters

moneytypestring'cash', 'bank', or 'crypto'.
amountnumberHow much to remove.
reasonstringOptional reason for logs.

Example

local Player = QBCore.Functions.GetPlayer(src)
if Player and Player.Functions.RemoveMoney('cash', 100, 'shop-purchase') then
  -- payment succeeded, give the item
end

Common pitfalls

  • Check the boolean return — if it's false the player couldn't pay, so don't deliver the goods.
  • Do the remove-then-reward sequence server-side 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 →