> ## Documentation Index
> Fetch the complete documentation index at: https://ugcore.urging.ch/llms.txt
> Use this file to discover all available pages before exploring further.

# ox_target scripts

> Run scripts written for ox_target without changes.

ug-target declares `provide 'ox_target'`. Resources that depend on `ox_target` start against it, and `exports.ox_target` calls reach ug-target.

## Supported exports

`addGlobalPed`, `addGlobalVehicle`, `addGlobalObject`, `addGlobalPlayer`, `addGlobalOption`, their `remove` forms, `addModel`, `removeModel`, `addEntity`, `removeEntity`, `addLocalEntity`, `removeLocalEntity`, `addSphereZone`, `addBoxZone`, `addPolyZone`, `removeZone`, `zoneExists`, `disableTargeting` and `isActive`.

## How options translate

| ox\_target | ug-target |
| - | - |
| `groups` | `conditions.groups` |
| `items`, `anyItem` | `conditions.items`, `conditions.anyItem` |
| `canInteract(entity, distance, coords, name, bone)` | Called with the same arguments. |
| `onSelect(data)`, `event`, `export` | Get ox\_target's data table: the context plus the option's own fields. |
| `serverEvent` | Triggered with the entity's network id, like ox\_target. |
| `command` | Run with `ExecuteCommand`. |
| `menuName`, `openMenu` | Submenus. |
| `offset`, `offsetAbsolute`, `offsetSize` | Ignored. |

Other fields of an option are passed back in the data table, as ox\_target does.

> [!TIP]
>
> `serverEvent` handlers trust what the client sends. When you touch a script, move its effect to a [server action](https://ugcore.urging.ch/ug-target/server-actions.md) so the server checks distance and conditions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.