Installation — ns-target
ns-target replaces ox_target / qb-target / qtarget. The real resources must not run next to it: both would answer the same exports.
- Remove the old target resource. Delete (or move out of
resources/) the foldersox_target,qb-targetandqtargetyou have. Keep yourensure ox_targetline inserver.cfg, the shim will use it. - Add ns-target. Copy the
ns-targetfolder intoresources/(any category folder works, e.g.[nullsect]). - Add the shims you need. They are empty resources with the old names, so scripts that check
GetResourceState('ox_target')or declaredependency 'ox_target'keep working. Copy them out ofns-target/compat/next tons-target:Shim Copy it when compat/ox_targetalways (ox_inventory, ox_doorlock, Qbox scripts, NullSect scripts look for it) compat/qb-targetyou run scripts made for qb-target compat/qtargetyou run old scripts that look for qtarget - server.cfg order. ns-target after ox_lib and the framework, shims after ns-target, everything that adds targets
after the shims:
ensure ox_lib ensure qbx_core ensure ns-target ensure ox_target # shim ensure qb-target # shim (optional) # ... ox_inventory, ox_doorlock, your scripts - Restart the server (not only the resource: other scripts register their targets when they start).
Verify
- The F8 console shows no
ns-targeterror.ox_target is running, so ns-target stays inactive ...means the real ox_target is still installed: ns-target then does nothing at all (no key, no exports) so the two never fight. - In game hold Left Alt next to an ATM or a shop counter: diamonds appear, the aimed one gets a frame and a menu.
- Left click, pick an option: the same thing happens as with ox_target.
- Press
1while aiming at something with options: the first option runs.
Troubleshooting
| Problem | Fix |
|---|---|
| A script says "ox_target not found" / its targets never show | Copy compat/ox_target next to ns-target and ensure it after ns-target. |
| qb-target scripts do nothing | Copy compat/qb-target and ensure it after ns-target. |
F8: X is running, so ns-target stays inactive | The real X is still in resources/. Remove it, copy the shim and restart the server. |
Targets are gone after restart ns-target | Same as ox_target: options live in memory. Restart the server (or the scripts that add targets). |
| No diamonds | Config.Markers.enabled; markers only show for things with an option you can use, in Config.Markers.distance. |
| Players want another key | Settings > Key Bindings > FiveM > "Target". The default is Config.Hotkey.key. |