oxclient
exports.ox_target:addBoxZone
ox client documentation with a FiveM Lua example.
Summary
Adds a box-shaped interaction zone with ox_target. Players get an eye/interaction prompt inside it. The modern standard for location interactions.
Returns
number — the zone id (for removal).
Parameters
optionstable{ coords, size, rotation, options = { {label, icon, onSelect} } }Example
-- CLIENT
exports.ox_target:addBoxZone({
coords = vec3(200.0, -1000.0, 30.0),
size = vec3(2,2,2),
rotation = 0,
options = {
{ label = 'Open Shop', icon = 'fa-shop', onSelect = function() end }
}
})Common pitfalls
- Requires ox_target.
- Keep the returned id if you need to remove the zone later.
- Don't recreate zones every frame — create once.
Related functions
Related guides
Need protected areas on your map?
Viper Safe-Zone draws polygon safe zones in-game — no hand-edited coordinates — with weapon, combat and vehicle-speed rules per zone.
See Viper Safe-Zone →