Exports
Target
Client

Client

Each option is { name, label, icon, distance, onSelect, canInteract }.

AddEntityTarget

Parameters

  • entity number — ped, vehicle, or object
  • options table — list of option tables

Returns

boolean

Example

Bridge.AddEntityTarget(entity, {
    {
        name = 'n_bridge_search',
        label = 'Search',
        icon = 'fa-solid fa-magnifying-glass',
        distance = 2.0,
        onSelect = function()
            Bridge.Notify({ description = 'Searched', kind = 'success' })
        end,
    },
})

AddModelTarget

Parameters

  • models number|number[] — model hash or a list of hashes
  • options table

Returns

boolean

Example

Bridge.AddModelTarget({ `prop_vend_soda_01` }, {
    {
        name = 'n_bridge_vending',
        label = 'Buy a drink',
        onSelect = function()
        end,
    },
})

AddBoxZone

Parameters

  • box table — { id, coords, size, rotation, options }
  • coords and size are vector3. rotation is degrees.

Returns

string|number — the zone id passed to RemoveTarget.

Example

local id = Bridge.AddBoxZone({
    id = 'counter',
    coords = vec3(0.0, 0.0, 0.0),
    size = vec3(1.5, 1.5, 1.5),
    rotation = 0.0,
    options = {
        {
            name = 'n_bridge_counter',
            label = 'Use counter',
            onSelect = function()
            end,
        },
    },
})

qb-target calls onSelect with { entity = entity }.

RemoveTarget

Parameters

  • id string|number — zone id from AddBoxZone, or an entity from AddEntityTarget

Returns

boolean

Example

Bridge.RemoveTarget(id)
Bridge.RemoveTarget(entity)
Join Our Discord