Custom Integrations
The entire custom/ folder is open under asset escrow. Every supported resource has one readable adapter, and each integration kind includes a custom.lua template. Never edit encrypted files under client/, server/, or shared/.
Workflow
Section titled “Workflow”- Open your third-party resource’s official documentation
- Find its client/server export for the action you need
- Set the matching integration slot to
'custom'inconfig/shared.lua - Implement the adapter in
custom/fuel/custom.lua,custom/keys/custom.lua, orcustom/target/custom.lua - Ensure the third-party resource before
lx-busjob - Restart and check the integration log in the client/server console
Adapter registry
Section titled “Adapter registry”Each file registers handlers by integration kind and exact resource name:
LxBusIntegrations.Register('fuel', 'my_fuel', { setFuel = function(vehicle, amount) exports['my_fuel']:SetVehicleFuel(vehicle, amount) end,})Then select it by exact name:
Config.Integrations.fuel = 'my_fuel'You have two supported approaches:
- Use
custom— edit the existingcustom/<kind>/custom.luatemplate and select'custom' - Add a named adapter — copy a neighboring adapter, rename its file and registration name, then select that resource name
Example key adapter:
-- custom/keys/my_keys.luaLxBusIntegrations.Register('keys', 'my_keys', { giveKeys = function(source, vehicle, plate) exports['my_keys']:GiveKeys(source, plate) },})Handler contract
Section titled “Handler contract”| Handler | Runtime | Arguments | Required return |
|---|---|---|---|
fuel.serverSetFuel |
Server | vehicle, amount |
none |
fuel.setFuel |
Client | vehicle, amount |
none |
keys.giveKeys |
Server | source, vehicle, plate |
none |
target.addEntityTarget |
Client | entity, options |
true when registered |
target.removeEntityTarget |
Client | entity |
none |
serverSetFuel is optional and only needed by state-bag/server-owned fuel systems. All handlers run through pcall; failures print the adapter kind, name, handler, and error without crashing the bus job.
Common mistakes
Section titled “Common mistakes”Wrong runtime
Section titled “Wrong runtime”fuel.setFuel and target handlers run client-side. fuel.serverSetFuel and key handlers run server-side. Calling a client-only export from a server handler will fail even if the export name is correct.
Wrong resource name
Section titled “Wrong resource name”Export resource names are exact and case-sensitive:
exports['My-Fuel'] -- not the same as exports['my-fuel']Missing return from custom target
Section titled “Missing return from custom target”target.addEntityTarget must return true. Otherwise Advanced Bus Job assumes registration failed and displays its [E] fallback.
Editing the core bridge
Section titled “Editing the core bridge”Do not edit client/bridge.lua, server/bridge.lua, or shared/bridge.lua. They are escrow-protected and replaced on updates. Files under custom/ are the supported extension point.
Asking LX support for help
Section titled “Asking LX support for help”Include:
- a link to the third-party resource’s official export documentation
- its exact resource folder name
- whether the export is client or server side
- your adapter code and full console error
We cannot safely integrate undocumented or leaked resources.