🚗 Core Vehicle - Realistic Vehicle (Mileage, Manual, Nitro, Check Engine, Low Oil, Custom Engine Sounds,)

[ script:core_vehicle] SCRIPT ERROR: @core_vehicle/server/main.lua:21: attempt to index a nil value (local ‘xItem’) everytime i dont have the item required it gives an error, you need to add checks for that stuff. shownotification at least @DeivisMac2

This error is not that you don’t have the item, but that you don’t have the item in your server’s database. Not all necessary items in the script are pre-installed in the database within the script. You need to add the item manually in your items table, and in your inventory whether it is esx or disc or other

The notification when you do not have the item in the inventory already exists is the [‘not_enough’]

well I did add ‘nos’ item to the table maybe I forgot to restart the server.

is it supposed the nitro to breake the engine ? the more i use it the more health takes from the engine

Yes because in real life nitro puts alot of stress to your engine

then i repair the engine and it dissapears and gives me an error

and the script breaks

You have problems with your sql then

always on screen

what you mean the engine fixes using the item i have in the sql

[‘stock_engine’] = {

    label = "STOCK ENGINE", 

    power = 0.0,

    durability = 80.0,

    usability = {exclusive = {}, vehicletypes = {}},

    sound = "DEFAULT",

    repair = {

        ['repairkit'] = {amount = 1, reusable = false},

       -- ['stock_oil'] = {amount = 1, reusable = false}

    }

}, thats how i have it, it fixes the engine than it breaks the script

[ERROR] [MySQL] [core_vehicle] An error happens on MySQL for query “REPLACE INTO vehicle_parts (plate, parts) values('car parts instaled but i deleted”}}’)": ER_NO_DEFAULT_FOR_FIELD: Field ‘mileage’ doesn’t have a default value
same thing hapens for the the id, i changed to a value of zero and now the engine ware becomes very fragil, cant drive the car for more than 3 minutes

Very awesome!

1 Like

Add default values in sql structure for mileage 0 and you can delete id

Tinha que ser brazuka cantando kkk

about the engine error a lot of people are reporting. I had this also 2 times now. And always it seems to insert the wrong data into the database for the engine like this here:

“engine”:{“health”:100.0,“type”:“race_brakes”,“label”:“RACE BREAKS”}

in the first case from an other car i had the race_suspension in there but there should be an engine inside. I dont know why this happens.

Thanks for the response but I fixed it, I just added null and its working, everything saves on sql and vehicle parts ware are back to normal

Does anyone else use the resource RealisticVehicleFailure with this script?

Also, is it possible for people who aren’t mechanics to fix or do a temp fix on their vehicle?

It works with realistic failure and you can set what it takes to repair and replace certain parts. Example that toolbox that everyone can use can access breaks, engine and oil.

Have you saw the errors about the engine in the database? i wrote it above it sometimes changes the item to something else.

also please please please update it so owned_vehicles only can use it. Our Database is allready full of npc cars since it inserts the database everytime someone clicks inspect on any vehicle.

Thanks a lot. A keep up the good work and idea of that resource :slight_smile: