# Implementation

If you want to invoke open **interact**.

```lua
exports["interact"]:Open("E", "MESSAGE")
```

If you want to invoke close **interact**.

```lua
exports["interact"]:Close()
```

***Parameters***

| PARAMETER | TYPE   |            |
| --------- | ------ | ---------- |
| key       | string | "E"        |
| message   | string | "Open ATM" |

## EXAMPLE USING

```lua
Citizen.CreateThread(function()
    local inRange = false
    local shown = false
    while true do
       inRange = false
       local myPed = PlayerPedId()
       local myCoords = GetEntityCoords(myPed)
       local targetCoords = vec(x, y, z)
       local distance = #(myCoords - targetCoords)
       if distance < 1.5 then
           -- Probably here you have ESX.ShowHelpNotification
           -- you changing this for inRange = true like under have
           inRange = true
           if IsControlJustPressed(0, 38) then
             -- if player press button, inRange must be false to not shown on screen
             inRange = false
             TriggerServerEvent("example")
          end
       end
       -- Here is a function to work interact
       if inRange and not shown then
            shown = true
            exports["interact"]:Open("E", "Vehicle shop")
        elseif not inRange and shown then
            shown = false
            exports["interact"]:Close()
        end
       Citizen.Wait(1)
    end
end)
```


---

# 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://docs.vames-store.com/free-assets/interact/implementation.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.
