[ESX/OX] Vehicle Keys System

Hey everyone,

I’m excited to share my latest project with the FiveM community – a completely free and open-source Vehicle Key System! This script is designed to work seamlessly with ox_lib, ox_inventory, and es_extended (legacy version) and provides an easy-to-use key system for vehicles based on their license plate.

Features:

  • Animations and key prop when using the key
  • Simple and intuitive commands, fully demonstrated in the video.
  • Utilizes exports specifically designed for developers, ensuring smooth integration.
  • Requires ox_lib, ox_inventory, and es_extended (legacy version) to function optimally.

Please note that the system relies on the presence of license plates on vehicles. If a vehicle does not have a license plate, the key functionality will not be activated.

I believe in giving back to the community that has given me so much, which is why I’m sharing this script for free. Feel free to modify, enhance, and use it to suit your own server’s needs.

You can find the script preview here

If you have any questions, suggestions, or feedback, please don’t hesitate to share them in the comments section. I’m here to support you and make this script even better!

Github

Installation

  1. Ensure you have the required dependencies, ESX, ox_lib and ox_inventory, installed in your project.

  2. Download release v1.0.0 from the releases

  3. Add the Vehicle Key System to your server resource folder.

  4. start the script into the server.cfg (after ox_inventory, ox_lib and ESX).

  5. Start your server, and the system will be ready to use!

Adding the Item to ox_inventory

To enable the item “Vehicle Key” in ox_inventory, follow these steps:

  1. Open the ox_inventory/data/items.lua file in your server.

  2. Add the following code to the items table:

['keys'] = {
    label = "Vehicle Key",
    weight = 15,
},
9 Likes

good work bro

2 Likes

Thanks !

1 Like

How does it work? The player does /addkey and if they are the owner it gives them a copy of the keys for the specific car with the specific license plate? or how does the key get assigned

Hey no the commands are for admins only, if you want to add keys to a player when buying a vehicle for example you have to use the exports https://github.com/idev-co/idev_keys/blob/main/server/exports.lua

is there a way to make it so they dont have to have they keys in their pocket? people buy and use several different cars and when you have 7 different keys in your pocket it gets messy

1 Like

where do i put the script in? like where in the vehicleshop script

in the ressouce folder maybe core

Hello , Can someone help me with the keys cuz i wanna do when someone gonna buy a vehicle they gonna get a Car keys and when they gonna store the car in the garage the car key gonna remove from his inventory

How can i Change the Notify Message i want that the Notify is from esx_notify