I came up with is code below but it tosses out nil values errors on testing. I’m working on fee system to charge for damage to rental car, I’m getting basic stuff in place to mess about plan to move this to server side later.
using the RegisterCommand for this below
RegisterCommand('PayDaFee', function()
local Player = QBCore.Functions.GetPlayerData()
local Balance = Player.PlayerData.money['bank']
local cashBalance = Player.PlayerData.money['cash']
local DaFee = '100'
if Balance >= DaFee then
Player.Functions.RemoveMoney('bank', DaFee, 'Damage Fee')
else
QBCore.Functions.Notify('Your broke....', 'error', 5000)
end
end)
runs with ExecuteCommand(‘PayDaFee’)