Target Systems
Targeting is only used for the local depot dispatcher ped. No target resource is required.
Config.Integrations.target = 'auto'ox_target
Section titled “ox_target”When ox_target is started, Advanced Bus Job registers the depot ped with:
exports.ox_target:addLocalEntity(entity, options)The ped is local to each client, so addLocalEntity is the correct API. Cleanup uses:
exports.ox_target:removeLocalEntity(entity)Setup:
ensure ox_targetensure lx-busjobConfig.Integrations.target = 'ox_target' -- or 'auto'qb-target
Section titled “qb-target”The bridge converts the neutral LX option format into qb-target options and calls:
exports['qb-target']:AddTargetEntity(entity, { options = qbOptions, distance = 2.5,})Cleanup uses RemoveTargetEntity.
Config.Integrations.target = 'qb-target'Official qb-target documentation
Built-in keypress fallback
Section titled “Built-in keypress fallback”Config.Integrations.target = 'none'Players receive the built-in text UI and press [E] near the depot NPC. This is also the automatic fallback when:
- no supported target resource is started
- a forced resource name is not running
target = 'custom'is set but no custom add hook exists- the custom add hook returns
falseornil
Custom target system
Section titled “Custom target system”Set:
Config.Integrations.target = 'custom'Then implement both handlers in custom/target/custom.lua:
LxBusIntegrations.Register('target', 'custom', { addEntityTarget = function(entity, options) exports['my_target']:AddEntity(entity, options) return true -- required: tells lx-busjob the target was registered end,
removeEntityTarget = function(entity) exports['my_target']:RemoveEntity(entity) end,})The add hook receives neutral options:
{ { name = 'unique_option_name', icon = 'fa-solid fa-bus', label = 'Open LST Terminal', distance = 2.5, canInteract = function(entity, distance, coords, name, bone) return true end, onSelect = function() -- opens the terminal end, }}If your target resource expects event names instead of function actions, wrap option.onSelect in the callback shape its documentation requires.