GenZeeDocs
Switching from…

Switching from ox_target

Keep every ox_target and qtarget registration and let players choose how they interact.

Universal Targeting's registration API uses ox_target's names and option fields, so existing scripts work without changes.

With the bridge

This is the easy path, and the one to use if you also run Universal UI.

  1. Install Universal Targeting.
  2. Keep ox_target installed and ensure universal_bridge after it, then universal_targeting. See Load order.
  3. Restart. Every exports.ox_target:* call and every legacy qtarget registration now goes to Universal Targeting, and ox_target's own eye is switched off.

Nothing in ox_target is modified. Stop the bridge and it behaves as before.

Without the bridge

Change exports.ox_target to exports.universal_targeting in your scripts. The function names and option tables stay the same.

exports.universal_targeting:addGlobalVehicle({
    {
        name = 'my_trunk',
        label = 'Open trunk',
        icon = 'fa-solid fa-car-rear',
        bones = { 'boot' },
        distance = 2.0,
        onSelect = function(data)
            -- data.entity is the vehicle
        end,
    },
})

What carries over

  • Registration: addGlobalOption, addGlobalPed, addGlobalVehicle, addGlobalObject, addGlobalPlayer, addModel, addEntity, addLocalEntity, the matching remove* calls, and sphere, box and poly zones.
  • Option fields: label, name, icon, distance, bones, canInteract, onSelect, event, serverEvent, export, command, groups, items, menuName and openMenu.
  • Cleanup: everything a resource registers is removed when that resource stops.
  • Zones: remove them by numeric id (ox style) or by name (qtarget style).

The full list is on Universal Targeting's exports page.

On this page