Skip to content

Vehicle Keys

The job bus is always unlocked when it spawns. A vehicle-key integration additionally registers the driver as a key holder so the server’s lock/engine system recognizes them.

Config.Integrations.keys = 'auto'

Auto-detection checks this order:

Resource API used Side
qbx_vehiclekeys GiveKeys(source, vehicle, true) Server
qb-vehiclekeys vehiclekeys:client:SetOwner Server → client event
wasabi_carlock GiveKey(source, plate) Server
MrNewbVehicleKeys GiveKeysByPlate(source, plate) Server

Official references:

ensure qbx_core
ensure qbx_vehiclekeys
ensure lx-busjob
Config.Integrations.keys = 'qbx_vehiclekeys'

Advanced Bus Job creates a Qbox session ID for the spawned vehicle, then calls the documented server export:

exports.qbx_vehiclekeys:GiveKeys(source, vehicle, true)

The final true suppresses duplicate key notifications.

Config.Integrations.keys = 'qb-vehiclekeys'

The script sends the standard compatibility event to the driver with the trimmed bus plate:

TriggerClientEvent('vehiclekeys:client:SetOwner', source, plate)
Config.Integrations.keys = 'wasabi_carlock'

The documented server export receives the driver’s server ID and plate:

exports.wasabi_carlock:GiveKey(source, plate)
Config.Integrations.keys = 'MrNewbVehicleKeys'
exports.MrNewbVehicleKeys:GiveKeysByPlate(source, plate)

Set:

Config.Integrations.keys = 'custom'

Then edit custom/keys/custom.lua:

LxBusIntegrations.Register('keys', 'custom', {
giveKeys = function(source, vehicle, plate)
exports['my_keys']:GiveKeys(source, plate)
end,
})

The adapter runs server-side when the bus spawns and once more shortly afterward to tolerate key-resource/entity timing.

Argument Type Meaning
source number Driver’s server ID
vehicle number Server-side vehicle entity handle
plate string Trimmed plate, for example LXBUS4821

Do not trust a client event to grant permanent ownership in a custom integration. Use your key script’s documented server export whenever one exists.

Every bundled implementation is readable under custom/keys/. If your installed version changed its export, adjust that adapter instead of editing server/bridge.lua.

Config.Integrations.keys = 'none'

The bus is still network-unlocked and fully driveable, but no external ownership key is created.