QB-Vehiclekeys

No problem, be sure to mark my original reply as a solution in order to help others quickly find a solution in the future.

Edit the number after the <= symbol. <= 70 means less than or equal to 70, which means if a random number from 1-100 is less than or equal to 70 then the true rate of that if statement is 1-70 (70% chance), meanwhile the else statement is the other 30 (70-100)

i dont seem to be getting the keys when finishing a carjack successfully now that i tried it this is one experience haha

Alright thanks for that

I’ll edit the code to re-add it to the stealing a driving car code

well i dont mean for parked vehicles i mean like when i aim my handgun and make them get out they run off and i get no keys i have to find the keys also when i steal a vehicle thats already on and a npc is driving it unlocked it shuts the car off then i have to find keys when its already on to begin with not sure if thats something that can be changed though but my main concern is that it doesnt give keys when taking someone out at gun point

I edited the code that runs when you steal an NPCs car who is driving so you can acquire the vehicle keys

alright thanks ill add it right now

1 Like

still for some reason doesnt work

can i share a video of what i mean?

The code for stealing vehicles with a weapon and getting keys is different

This is what i mean by that
2022-08-19 19-05-12.flv (24.7 MB)

oh is it apart of the same script or is it something completely different?

Same script: qb-vehiclekeys/main.lua at main · qbcore-framework/qb-vehiclekeys · GitHub

would it be possible to keep a vehicle running thats already running when stealing a vehicle? because i think thats what causes it as i showed in the video i sent

Is there a working copy of this script yet, I feel like it unlocks all cars

I had the same issue when implementing this myself make sure you have the latest QB-Vehiclekeys found here https://github.com/qbcore-framework/qb-vehiclekeys/archive/refs/heads/main.zip and make sure you take his fork on github found here qb-vehiclekeys/main.lua at main · Qwerty1Verified/qb-vehiclekeys · GitHub then once you have done that make sure you delete all the things inside the qb-vehiclekeys/client/main.lua folder then paste his fork version and it should work perfectly fine i fixed it by doing those things also make sure you set Config.LockNPCDrivingCars and Config.LockNPCParkedCars to TRUE in the config file for QB-Vehiclekeys once youve updated it

1 Like

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