> For the complete documentation index, see [llms.txt](https://a-n.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://a-n.gitbook.io/docs/an-interaction-menu.md).

# AN Interaction Menu

## [🛒 Buy Script](https://a-n.tebex.io/package/5375244)

<div align="center"><figure><img src="/files/SRQbFDR4mEdWxV75KNxm" alt="AN Interaction Menu"><figcaption><p><strong>A GTA 6 Inspired Interaction Menu</strong> | Product Price: <strong>7.99 EUR + Tebex Taxes</strong></p></figcaption></figure></div>

## How to use?

### Adding an Interaction Menu&#x20;

```lua
-- Adding Interaction Menu
exports["an_interMenu"]:add({
    entity = entity, -- if you want to show the interaction menu on an entity, then use this and comment the one below
    coords = coords, -- if you want to show the interaction menu on specific coords, then use this and comment the one above
    actions = { -- you can trigger a server event, client event, command, or local Lua function
        [1] = {key = "X", label = "label", event = "SVevent:name", type = "sv", args = { entity = targetEntity }, useDist = 1.5 },
        [2] = {key = "Y", label = "label", command = "command args1 args2 args3", useDist = 3.0 },
        [3] = {key = "E", label = "label", event = "CLevent:name", type = "cl", args = {}, useDist = 6.0 },
        [4] = {key = "G", label = "label", func = function() print("You pressed G!") end, useDist = 2.0 },
    },
    showDist = 8.0, -- distance at which the menu becomes visible
    offset = {x = 1.0, y = 2.0, z = 1.0}, -- used to set the position offset for the menu when using an entity
    handle = "something_unique_14581" -- a unique identifier (must be different for each menu added)
})
```

#### ✅ Action Types Supported:

* `event`: Trigger a client (`type = "cl"`) or server (`type = "sv"`) event.
* `command`: Execute a command for the player.
* `func`: Run a local Lua function (note: only client-side).
* `args`: Optional arguments table passed to events.
* `useDist`: Distance at which the key press becomes valid.
* `key`: The key to press (e.g., "E", "X", "G").
* `label`: The label shown in the interaction menu.

### Hiding an Interaction Menu&#x20;

The Interaction Menu normally automatically hides when you're not in the required distance ( `showDist` ) but this method can force hide the Interaction Menu.

```lua
exports["an_interMenu"]:hide("something_unique_14581") -- use the same unique name that you typed when adding the interaction menu
```

### Removing an Interaction Menu

Fully removes the interaction menu

```lua
exports["an_interMenu"]:remove("something_unique_14581") -- use the same unique name that you typed when adding the interaction menu
```

###
