# 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
```

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://a-n.gitbook.io/docs/an-interaction-menu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
