Adding addon cars into qb core garages

so i put a teslapd into vehicles.lua in qbcore/shared and into qb-vehicleshop i made a category for it but when i load into the server, the phone not does work and gives me an error in the console “SCRIPT ERROR: @qb-garages/server/main.lua:284: attempt to index a nil value (field ‘Vehicles’)” everytime i try to use the phone, anyone know how i can make the addon cars go into garages and be stored there and in pdm?

Hello so for the vehicles.lua make sure first of all that you are using this format

['blista'] = {
        ['name'] = 'Blista',
        ['brand'] = 'Dinka',
        ['model'] = 'blista',
        ['price'] = 13000,
        ['category'] = 'compacts',
        ['categoryLabel'] = 'Compacts',
        ['hash'] = `blista`,
        ['shop'] = 'pdm',
    },

Next make sure that the category on the left side so [‘______’] has the same category name. So for example compacts no capital. This is all you should need to make it work for qb garages and pdm. If you are receiving a error still than the issue is in vehicles.lua or vehicleshop.lua

1 Like

i will try this and reply if it works or not

i did this but i still get this

image

The issue could now either be with the model itself as in the code you are using is wrong. So try spawning the car with /car 720stc . If it works then that is not the issue if it doesn’t then thats the issue. Make sure the folder name is also 720stc. If thats not the issue then you might have a database issue

So ive done some snooping around and i believe im missing vehicles and vehicle categories from my database, apart from that nothing else would explain it as i have those cars on my vmenu and they spawn in fine, is there any chance you could help me make those 2 tables im missing or give me a sql file to import into my database as i believe vehicles amd vehicles categories should be there but arent

Yes if you would like add my discord username aspect041 and I will help you. If you want to do it yourself then go to this github and download it GitHub - qbcore-framework/qb-vehicleshop the sql is in there and then go ahead and import it

thankyou, i sent you a request

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