Skip to main content
The bridge ships client-side world helpers you can use in any resource: Interact for “press E” prompts on points and entities, Zones for area triggers, and Blips for the map. They are pure-Lua libraries that load into your VM, follow the theme accent, and free themselves when your resource stops. These are client-side namespaces.

Interact

Bridge.Interact puts a keycap on a world point or entity. When the player is within distance, the keycap shows; within expandDistance it expands into a navigable option list (arrow keys / scroll to move, the confirm key to select). A single-option shorthand also works.
local h = Bridge.Interact.Add({
    coords = vec3(215.7, -810.1, 30.7),
    label = 'Storage locker',
    key = 'E',                 -- confirm key: a letter or a control id
    distance = 2.5,            -- show the keycap within this range (m)
    expandDistance = 1.2,      -- expand to the option list within this range (m)
    options = {
        { label = 'Open stash', icon = 'box',
          onSelect = function() openStash() end },
        { label = 'Toggle lock', icon = 'lock',
          canInteract = function() return isOwner end,
          onSelect = function() toggleLock() end },
    },
})

h.Remove()
Single-option shorthand — pass label + onSelect directly, no options list:
Bridge.Interact.Add({ coords = vec3(...), label = 'Fish', onSelect = startFishing })

Anchor to a moving entity

Pass entity or netId instead of coords to track a moving object; offset shifts the anchor from its origin.
Bridge.Interact.Add({
    netId = vehicleNetId,
    offset = vec3(0.0, 0.0, 1.0),
    label = 'Inspect vehicle',
    onSelect = inspect,
})

Options & fields

coords | entity | netId
vector3 | integer
The anchor. Use coords for a fixed point, or entity / netId to track a moving object.
label
string
Text shown when the prompt is collapsed (and the default option label).
key
string | integer
default:"E"
The confirm key. A letter ('E', 'F', 'G', 'H', 'K', 'N', 'M', 'B', 'R', 'SPACE') or a raw control id.
distance
number
default:"2.0"
Range at which the keycap appears.
expandDistance
number
Range at which the prompt expands into the option list.
offset
vector3
Offset from the anchor entity’s origin.
options
table[]
The option list. Each option: label, icon, canInteract (a function returning a boolean), onSelect.
canInteract
fun(): boolean
Top-level gate for the whole prompt (single-option form).
An option’s onSelect runs in your resource’s VM, so it sees your script’s state directly — there is no event bus.

Suspend & resume

Hide all of your resource’s prompts under a named reason (reference-counted, so nested suspends are safe). Useful while a menu is open.
Bridge.Interact.Suspend('inMenu')
-- ... menu open ...
Bridge.Interact.Resume('inMenu')
MethodEffect
Bridge.Interact.Add(opts)Add a prompt; returns { id, Remove }.
Bridge.Interact.Remove(id)Remove a prompt by id.
Bridge.Interact.Suspend(reason?)Hide this resource’s prompts under a reason.
Bridge.Interact.Resume(reason?)Lift a suspend reason.
Bridge.Interact is the bridge’s own interaction system and is always available. For entity/zone targeting that integrates with ox_target / qb-target, use Bridge.Target instead.

Zones

Bridge.Zones fires callbacks as the player crosses area boundaries. onEnter / onExit fire on boundary crossing; onInside runs per-frame while inside. Use zones for static areas (job zones, safe zones, blip triggers); for “press E” prompts use Interact above. One adaptive scan loop drives every zone, so they are cheap at idle.
local z = Bridge.Zones.Box(vec3(...), { x = 4, y = 4, z = 3 }, {
    heading = 45.0,
    onEnter  = function() Bridge.Notify.Info('Entered the shop') end,
    onExit   = function() end,
    onInside = function() end,   -- per-frame while inside
})

z:Remove()

Shapes

local z = Bridge.Zones.Sphere(vec3(...), 5.0, { onEnter = fn, onExit = fn })

The zone handle

z:IsInside()    -- boolean
z:Distance()    -- distance to the zone center
z:Disable()     -- stop firing (fires onExit if currently inside)
z:Enable()
z:Remove()
ConstructorShape
Bridge.Zones.Sphere(coords, radius, opts)A sphere.
Bridge.Zones.Box(coords, size, opts)A heading-rotated box.
Bridge.Zones.Circle(coords, radius, opts)A vertical cylinder.
Bridge.Zones.Poly(points, opts)A polygon with optional Z bounds.
All opts accept onEnter, onExit, onInside, enabled, id, and data.

Blips

Bridge.Blips wraps the GTA blip natives with a tracked handle, and frees every blip your resource created when it stops.
local b = Bridge.Blips.Add({
    coords = vec3(...),
    sprite = 280,
    color = 5,
    scale = 0.8,
    label = 'Bank',
    shortRange = true,
})

b:SetColor(3):SetRoute(true)   -- chainable
b:Remove()

Radius blip

local r = Bridge.Blips.AddRadius({ coords = vec3(...), radius = 50.0, color = 1, alpha = 128 })

Options & handle

coords
vector3
required
Blip position.
sprite
integer
default:"1"
Blip sprite id (coord blips only).
color
integer
default:"0"
Blip color id.
scale
number
default:"0.8"
label
string
Map name for the blip.
display / shortRange / alpha / route / routeColor
various
Standard blip styling; route = true draws a GPS route to the blip.
The handle is chainable: SetColor, SetSprite, SetScale, SetAlpha, SetLabel, SetRoute(on, color?), plus Exists() and Remove().
MethodEffect
Bridge.Blips.Add(opts)Add a coord blip; returns a handle.
Bridge.Blips.AddRadius(opts)Add a radius blip; returns a handle.
Bridge.Blips.Clear()Remove every blip this resource created.
Need a glowing in-world icon instead of a map blip? Bridge.MarkerProp.Spawn({ coords, icon }) spawns a ground-snapped, theme-recolored marker prop. Bridge.Interact can spawn one automatically via its marker option.