QBCore-vehicleshop v1 issues

Hello so I am using QBCore-vehicleshop v1 but I am running into an issue with the script this is the error I am getting the following error’s any one have an idea why QBCore comes up as Nill?


Here is line 41 of main.lua

RegisterNetEvent('QBCore:Client:OnPlayerLoaded')
AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
    PlayerJob = QBCore.Functions.GetPlayerData().job
    isLoggedIn = true
end)

Did you initialize the QBCore object?

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

Do you have this line at the top of your script?

I guess qbcore-vehicleshop v1 released by the qbcore team didn’t include that?

Link this ‘QBCore-vehicleshop v1’. Like @inGyni said above, it cannot find qb-core, which means the framework either A) isn’t started, or B) isn’t grabbing the export.

I did solve that issue just didn’t have a chance to respond but now I am running into a brand new issue when someone goes to a custom dealership. error below and code at line 192 the weird behavier prevents menu from showing up to pick a vehicle but it only happens when you walk up to a buyable vehicle.

      if not QB.VehicleShops[ClosestShopIndex]["ShowroomVehicles"][ClosestVehicle].inUse then
                    local vehicleHash = GetHashKey(QB.VehicleShops[ClosestShopIndex]["ShowroomVehicles"][ClosestVehicle].chosenVehicle)
                    local displayName = QBCore.Shared.Vehicles[QB.VehicleShops[ClosestShopIndex]["ShowroomVehicles"][ClosestVehicle].chosenVehicle]["name"]
                    local vehPrice = QBCore.Shared.Vehicles[QB.VehicleShops[ClosestShopIndex]["ShowroomVehicles"][ClosestVehicle].chosenVehicle]["price"]

                    if not QB.VehicleShops[ClosestShopIndex]["ShowroomVehicles"][ClosestVehicle].inUse and not QB.VehicleShops[ClosestShopIndex]["OwnedJob"] then
                        if not QB.VehicleShops[ClosestShopIndex]["opened"] then

would you happen to know why?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.