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

RegisterNetEvent("hp_mechanic:buyitem")
AddEventHandler("hp_mechanic:buyitem", function (price)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    if Player.PlayerData.money.bank >= price then
        Player.Functions.RemoveMoney('bank', price)
        TriggerClientEvent("hp_mechanic:cl:buyitem", source)
    elseif Player.PlayerData.money.cash >= price then
        Player.Functions.RemoveMoney('cash', price)
        TriggerClientEvent("hp_mechanic:cl:buyitem", source)
    else
        nofity(source, Config.Langs["NoPrice"])
    end
end)