Bennys issue getting error not enough money

Hey guys so I’m having an issue on my test server so i installed Benny’s spawned myself in cash and bank money an went to Benny’s and got a error saying not enough money thought maybe y’all would have some ideas any help is appreciated thanks in advance

You need to add money into the business (bossmenu)

i dont think thats the issue cuz i even went into my friends city he can do it i cant

Check where it’s accessing your money, maybe it’s not pulling the proper function to check money?

More than likely a configuration issue, but without code to look at not much anyone here can do.

k this is the lua file

local QBCore = exports[‘qb-core’]:GetCoreObject()

local repairCost = vehicleBaseRepairCost

RegisterNetEvent(‘qb-customs:attemptPurchase’, function(type, upgradeLevel)

local source = source

local Player = QBCore.Functions.GetPlayer(source)

local balance = nil

--if Player.PlayerData.job.name == "mechanic" then

    --balance = exports['qb-bossmenu']:GetAccount(Player.PlayerData.job.name)

--else

balance = Player.Functions.GetMoney(moneyType)

--end

if type == "repair" then

    if balance >= repairCost then

        --if Player.PlayerData.job.name == "mechanic" then

            --TriggerEvent('qb-bossmenu:server:removeAccountMoney', Player.PlayerData.job.name, chicken)

        --else

            Player.Functions.RemoveMoney(moneyType, chicken, "bennys")

        --end

        TriggerClientEvent('qb-customs:purchaseSuccessful', source)

    else

        TriggerClientEvent('qb-customs:purchaseFailed', source)

    end

elseif type == "performance" then

    if balance >= vehicleCustomisationPrices[type].prices[upgradeLevel] then

        TriggerClientEvent('qb-customs:purchaseSuccessful', source)

        --if Player.PlayerData.job.name == "mechanic" then

            --TriggerEvent('qb-bossmenu:server:removeAccountMoney', Player.PlayerData.job.name,

                --vehicleCustomisationPrices[type].prices[upgradeLevel])

        --else

            Player.Functions.RemoveMoney(moneyType, vehicleCustomisationPrices[type].prices[upgradeLevel], "bennys")

        --end

    else

        TriggerClientEvent('qb-customs:purchaseFailed', source)

    end

else

    if balance >= vehicleCustomisationPrices[type].price then

        TriggerClientEvent('qb-customs:purchaseSuccessful', source)

        --if Player.PlayerData.job.name == "mechanic" then

            --TriggerEvent('qb-bossmenu:server:removeAccountMoney', Player.PlayerData.job.name,

                --vehicleCustomisationPrices[type].price)

        --else

            Player.Functions.RemoveMoney(moneyType, vehicleCustomisationPrices[type].price, "bennys")

        --end

    else

        TriggerClientEvent('qb-customs:purchaseFailed', source)

    end

end

end)

RegisterNetEvent(‘qb-customs:updateRepairCost’, function(cost)

repairCost = cost

end)

RegisterNetEvent(“updateVehicle”, function(myCar)

local src = source

if IsVehicleOwned(myCar.plate) then

    exports['oxmysql']:execute('UPDATE player_vehicles SET mods = ? WHERE plate = ?', {json.encode(myCar), myCar.plate})

end

end)

function IsVehicleOwned(plate)

local retval = false

local result = exports['oxmysql']:fetchScalar('SELECT plate FROM player_vehicles WHERE plate = ?', {plate})

if result then

    retval = true

end

return retval

end

there ya are brother sorry

Well there’s your issues, plain as day.
And I say issues, plural… Because there are multiple.
Did you go through this script and edit it? Or was it done by someone else that also doesn’t know what they’re doing?

You are passing moneyType as a variable;

Player.Functions.RemoveMoney(moneyType, chicken, "bennys")

But that is just the helper for you to actually put a string value of the money type, such as “cash” or “bank”, etc. And also, you are passing some nil variable called chicken for one of these instances. What on earth?!?! Where did you get this script? Or why did you edit it so much without knowing what you are doing? :joy:

It should be something like this;

Player.Functions.RemoveMoney("cash", repairCost, "bennys")

I’ve done you a favour. Since half the script was commented out because apparently you or the other editor doesn’t want mechanics to bill the society, I have cleaned it up and fixed the errors. I also then rewrote it to remove redundancies. Hence the deleted post above.

Enjoy!

local QBCore = exports["qb-core"]:GetCoreObject()

local repairCost = vehicleBaseRepairCost

RegisterNetEvent("qb-customs:attemptPurchase", function(type, upgradeLevel)
	local source = source
	local Player = QBCore.Functions.GetPlayer(source)
	local balance = Player.Functions.GetMoney("cash")
	local cost = vehicleCustomisationPrices[type].price
	if type == "repair" then
		cost = repairCost
	elseif type == "performance" then
		cost = vehicleCustomisationPrices[type].prices[upgradeLevel]
	end
	if balance >= cost then
		Player.Functions.RemoveMoney("cash", cost, "bennys")
		TriggerClientEvent("qb-customs:purchaseSuccessful", source)
	else
		TriggerClientEvent("qb-customs:purchaseFailed", source)
	end
end)

RegisterNetEvent("qb-customs:updateRepairCost", function(cost)
	repairCost = cost
end)

RegisterNetEvent("updateVehicle", function(myCar)
	local src = source
	if IsVehicleOwned(myCar.plate) then
		exports["oxmysql"]:execute("UPDATE player_vehicles SET mods = ? WHERE plate = ?", { json.encode(myCar), myCar.plate })
	end
end)

function IsVehicleOwned(plate)
	local retval = false
	local result = exports["oxmysql"]:fetchScalar("SELECT plate FROM player_vehicles WHERE plate = ?", { plate })
	if result then
		retval = true
	end
	return retval
end