CreateThread(function()
    Framework = "qb-core"
    UsingOxInventory = false
    if GetResourceState('qbx_core') == 'started' then
        Framework = "qbox"
    elseif GetResourceState('qb-core') == 'started' then
        QBCore = exports['qb-core']:GetCoreObject()
        Framework = "qb-core"
    end
    if GetResourceState('ox_inventory') == 'started' then
        UsingOxInventory = true
    end
end)

function GetItemLabel(item)
    if GetResourceState('ox_inventory') == 'started' then
        return exports.ox_inventory:Items(item).label
    else
        return QBCore.Shared.Items[item].label
    end
end

function GetItemImage(item)
    if GetResourceState('ox_inventory') == 'started' then
        return exports.ox_inventory:Items(item).client.image
    else
        return "nui://" .. Config.InventoryImage .. QBCore.Shared.Items[item].image
    end
end

function Notify(label, message, type)
    lib.notify({
        title = label,
        description = message,
        duration = 7500,
        type = type
    })
end

function MilkCowsMinigame()
    local success = lib.skillCheck(
        {
            {
                areaSize = 50,
                speedMultiplier = 0.5
            }, {
                areaSize = 50,
                speedMultiplier = 0.5
            }, {
                areaSize = 50,
                speedMultiplier = 0.5
            }
        },
        {'w', 'a', 's', 'd'}
    )
    return success
end

RegisterNetEvent('cb-farming:client:NotEnoughSpace', function()
    Notify('Farming', 'You do not have enough space in your inventory!', 'error')
end)