[Release][Standalone] xd_locksystem V2 | Vehicle Key System!

Welcome to my release this version of the lock system is much better from the previous one,
by performance, gameplay and features.

This script is completely Free.

This resource will upgrade your roleplay server with more features for players to use with vehicles, to make the roleplay experience better.


Features

  • Locking/Unlocking vehicles with animation and car key prop.

  • Lockpick locked vehicles with a cool minigame.

  • Hotwire vehicles to start the engine without keys.

  • Rob keys from npc driving around you.

  • Ability to give your keys to other player.

  • Everything Synced with the server.

  • Many customizable configs to match your server prefrences.


Developers

Exports

To set owned vehicle keys you can use the exports below.

exports['xd_locksystem']:SetVehicleKey(plate, remove)
  • plate - the vehicle license plate.

  • remove - if true then it will remove the key from any player.

exports['xd_locksystem']:GetVehicleData(plate)
  • plate - the vehicle plate you want to check key for.

    this will return 2 values:

  • keys - with these values

    • false - no one have keys to the vehicle.

    • true - someone have keys to the vehicle.

    • ‘self’ - current player have keys to vehicle.

  • lockpick - with these values

    • false - vehicle have not lockpicked.

    • true - vehicle lockpicked.

    • ‘NPC’ - used in the script to prevent from players to lockpick npc vehicles driving around.

Example

client script:

RegisterCommand('engine', function()
    local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
    if vehicle ~= 0 then
        local plate = GetVehicleNumberPlateText(vehicle)
        local VehicleData = exports['xd_locksystem']:GetVehicleData(plate)
    
        -- make sure here to check if the current player have keys ↓
        if VehicleData.keys == 'self' then
            local engineState = GetIsVehicleEngineRunning(vehicle)
            SetVehicleEngineOn(vehicle, not engineState, false, true)
        end
    end
end)

Give key to other player

You can use the command:

/givekey [player_id]

if there is no id specified then closest player will get the key.


Help!

Please! if you need any help or found any bugs please open an issue at the resource github repository.


Video

Click Here for Video!


Download

Click Here to Download!
make sure you download from the releases section.


My Scripts

5 Likes

What keys are used for locking and engine? Cant figure it out :wink:

Very good !! I’ll try it !! Thank for created this <3

1 Like


I can’t find xd_core in your account !! :frowning:

Fixed please download again.

1 Like

You can see at Settings->Keybinds->Fivem
all keys are there and can be changed for each player for its own keys.

Thank alot!!

First test, sometime NPC car is open but go out and try to get in again, it’s locked.
Hotwire animation is cool, i love it !!
Minigame is ok!!
If you hate your inventory have too much key when use other source then you can custom in this source !!
Recomment for everyone!! Is best free source !!

ok i will check about the npc cars.
and thanks :slight_smile:

1 Like

I dont have any settings for this

image
In keybinding you can see it !! And engine you can use: ExecuteCommand

Just found out, im missing a dependency :wink:

yeah I forgot to delete my old code please remove it from fxmanifest or redownload the resource from github.

Works like a charme now - many thx

1 Like

Can you help me out again?
I bought, for tests, a car, but i dont get keys…

Can you explain, there i have to put in the exports?

after you spawn the vehicle and the vehicle is loaded
or
if you apply any changes to the vehicle plate then after that
use this export

exports['xd_locksystem']:SetVehicleKey(plate)

image
This is, how i placed the export, but still missing keys. Im to dumb i think…

If it helps, i use H-Vshop if needed

try moving it inside the ESX.TriggerServerCallback under ‘if not success’

nope…
may we write private, i wont spam it all here in :wink:

1 Like

Please do spam, and we all get a lesson

2 Likes