mcpField
O
ox-target

ox-target

github.com/germanfndezDevelopment1960 installsUpdated 2w ago
Repository

About ox-target

ox-target is a FiveM skill for adding interaction targets to entities, models, players, and locations. It guides developers through choosing the appropriate ox_target function and producing runnable Lua, including migration from qb-target.

Key features

  1. 01Selects target functions by entity or location type
  2. 02Supports entity, model, global, and zone targets
  3. 03Builds options with visibility and action routing
  4. 04Covers qb-target migration
  5. 05Outputs Lua using exports.ox_target

Use cases

  1. 01Adding an interaction to a vehicle, door, or prop
  2. 02Making a locally spawned entity interactable
  3. 03Migrating an existing qb-target interaction

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/germanfndez/fiveai-skills --skill ox-target

After installing, type/ox-targetin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

rules/
entities.md
migration.md
options.md
setup.md
zones.md

Details

From the project README

ox_target

Third-eye targeting for FiveM. Replaces qb-target and bt-target. Supports ox_core, esx and qbx_core.

Activation Contract

Load this skill when the user asks to make something interactable: "press E on this ped", "third eye", "target option", "add an interaction to this vehicle/door/prop", or when migrating from qb-target.

Hard Rules

  • Call every function through exports.ox_target:<fn>(...). There is no global ox_target table.
  • onSelect runs on the CLIENT. Never trust its arguments server-side: re-validate in the serverEvent handler.
  • Always pass name on an option you intend to remove later. Removal is by name, not by index.
  • distance defaults to the resource default; set it explicitly for anything above ~2.5m.
  • Zone and entity functions are CLIENT-side only.
  • Prefer addLocalEntity for entities you spawned yourself; use addEntity only for networked entities and expect the id to change on respawn.

Decision Gates

TargetFunction
One entity you spawned locallyaddLocalEntity(entities, options)
A networked entity (net id)addEntity(entities, options)
Every instance of a modeladdModel(models, options)
Every ped / vehicle / object / playeraddGlobalPed / addGlobalVehicle / addGlobalObject / addGlobalPlayer
Everything, no filteraddGlobalOption(options)
A location, not an entityaddBoxZone / addSphereZone / addPolyZone

Execution Steps

  1. Confirm ox_target is started AFTER ox_lib in server.cfg.
  2. Pick the function from the Decision Gates table.
  3. Build the options array. Read rules/options.md for every allowed field.
  4. Gate visibility with groups, items or canInteract rather than checking inside onSelect.
  5. Route the action: onSelect for client logic, serverEvent for anything that grants money, items or state.
  6. Store the returned zone id if the zone must be removed later.

Output Contract

Return runnable Lua using exports.ox_target. Include the fxmanifest.lua dependency lines when the resource is new. Never emit qb-target syntax.

References

  • rules/setup.md — install, fxmanifest, convars, framework support.
  • rules/options.md — every field of the option table.
  • rules/entities.md — entity, model and global targets.
  • rules/zones.md — box, sphere and poly zones.
  • rules/migration.md — qb-target to ox_target.

Upstream docs: https://overextended.dev/ox_target

Comments

Markdown supported