Skip to main content
addModel registers a rule: every matching vehicle, NPC ped, or object near the player becomes interactive automatically - no spawn tracking, no handles, no per-entity registration. One line covers every vending machine in the city.
Returns a rule id (number) on success, or nil with a console error explaining what’s wrong. exports.lation_interact:remove(id) removes the rule and every anchor it created, immediately. Rules are also cleaned up when your resource stops.
This page covers what addModel adds on top of the shared vocabulary. The anchor fields (label, options, icon, stages, expand, reveal, debug), the option table, condition gates, and handlers are documented in Options.

Parameters

string | number | (string | number)[]
Model name(s) or joaat hash(es) - a single value or an array, mixing names and hashes freely. Names are hashed for you. A call with no valid model rejects with a console error and returns nil.
table
required
The anchor template - all the shared anchor fields plus the same placement fields addEntity takes:
  • bone (string) - bone the anchor rides on each matching entity (e.g. 'boot'); missing bones fall through to offset, then to the entity center
  • offset (vector3) - entity-local offset from the center, rotating with the entity
A rule matches vehicles, NPC peds, and objects whose model is in the set. Player peds are never matched. Across all model and global rules combined, at most the nearest 24 matches are active at once - over the cap, the nearest win.

Merging

When several sources target the same entity at the same spot (same bone/offset/center), they merge into one stack, ordered by priority: explicit addEntity > model rules > globals. The highest-priority contributor provides the presentation (label, icon, stages, expand, reveal); the options stack beneath it in priority order.
The mission vehicle shows one trunk stack titled Evidence Van - never two overlapping anchors. A different bone or offset is a different spot and stays its own stack.
On a rule-created anchor, the handler payload’s data.id identifies which entity’s stack fired - it is not the rule id. Keep the id your addModel call returned; that’s the one remove(id) takes.

Behavior Notes

Rule-created anchors default to reveal = 'focus': nothing renders until the player looks at the entity. Pass reveal = 'ambient' on the rule to mark every match with a grain of light from a distance - right for vending machines, wrong for traffic.
The vehicle you’re sitting in is skipped by default. Scripts that expect their options while seated need Config.IncludeOwnVehicle = true.
A match moving faster than 3.0 m/s holds at the grain stage and can’t be focused. It becomes interactable the moment it slows down.
addModel is also an ox_target export name, told apart by shape: a native spec always carries an options array, while ox-style calls route to the compatibility bridge.

Example