Qb-garage

My garage menu is not opening. The menu is kinda opening. It opens until i click my vehicles. Then the menu just closes and thats it. Everytime i try to open my vehicles it gives me the following error. Can someone help me?

[ 1021156] [b2699_GTAProce] MainThrd/ ^1SCRIPT ERROR: @qb-garages/client/main.lua:459: attempt to index a nil value (field ‘?’)^7
[ 1021156] [b2699_GTAProce] MainThrd/ ^3> ref^7 (^5@qb-garages/client/main.lua^7:459)
[ 1021156] [b2699_GTAProce] MainThrd/ ^3> handler^7 (^5@qb-core/client/events.lua^7:102)
[ 1021156] [b2699_GTAProce] MainThrd/ ^1SCRIPT ERROR: error object is not a string^7

Can you share the code around line 459, in qb-garages/client/main.lua?
Also please mention which is line 459.

RegisterNetEvent(“qb-garages:client:VehicleList”, function()
QBCore.Functions.TriggerCallback(“qb-garage:server:GetUserVehicles”, function(result)
if result == nil then
QBCore.Functions.Notify(“You don’t have any vehicles in this garage!”, “error”, 5000)
else
local MenuPublicGarageOptions = {
{
header = "Garage: "…Garages[currentGarage].label,
isMenuHeader = true
},
}
for k, v in pairs(result) do
enginePercent = round(v.engine / 10, 0)
bodyPercent = round(v.body / 10, 0)
currentFuel = v.fuel
curGarage = Garages[v.garage].label
vname = QBCore.Shared.Vehicles[v.vehicle].name <— This is code line 459

            if v.state == 0 then
                v.state = "Out"
            elseif v.state == 1 then
                v.state = "Garaged"
            elseif v.state == 2 then
                v.state = "Impounded By Police"
            end

            MenuPublicGarageOptions[#MenuPublicGarageOptions+1] = {
                header = vname.." ["..v.plate.."]",
                txt = "State: "..v.state.." <br>Fuel: "..currentFuel.." | Engine: "..enginePercent.." | Body: "..bodyPercent,
                params = {
                    event = "qb-garages:client:takeOutPublicGarage",
                    args = v,
                }
            }
        end

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