> For the complete documentation index, see [llms.txt](https://docs.brutalscripts.com/site/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brutalscripts.com/site/scripts/text-ui/exports-and-how-to-use.md).

# Exports & How to use

## Client Exports / Triggers

<table><thead><tr><th width="550" align="center">Export</th><th align="center"></th></tr></thead><tbody><tr><td align="center">exports['brutal_textui']:Open(message, color, thema, position)</td><td align="center">Open export</td></tr><tr><td align="center">exports['brutal_textui']:Close()</td><td align="center">Close export</td></tr></tbody></table>

* Message\
  \- Text of the message\
  \- The message must include a box with the key/control: \[E] or \[G] or \[CTRL] or what you want to write in the box. For example: "\[E] Open the menu", "Open the menu \[F6]". No matter where you type within the code.
* Color\
  \- <mark style="color:blue;">blue</mark> / <mark style="color:red;">red</mark> / <mark style="color:green;">green</mark> / <mark style="color:yellow;">yellow</mark> / <mark style="color:purple;">purple</mark> / <mark style="color:orange;">orange</mark> / gray | custom can be added in the config.lua
* Thema\
  \- Between 1-4.
* Position\
  \- left / right

## How to use?!

```lua
local shown = false
local inDistance = false

Citizen.CreateThread(function()
    while true do
        inDistance = false
        
        local playerCoords = GetEntityCoords(GetPlayerPed(-1))
		if #(playerCoords- v.coords) < 50.0 then
			DrawMarker(20, v.coords, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.2, 0.2, 15, 100, 210, 255, false, true, 2, true, nil, false)

			if #(playerCoords- v.coords) < 2.0 then
				inDistance = true

				if not shown then
					shown = true
					exports['brutal_textui']:Open("[E] Open the Menu", "green", 1, "left")
				end
			end
		end

        if shown and not inDistance then
            exports['brutal_textui']:Close()
            shown = false
        end

        Citizen.Wait(1)
    end
end)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.brutalscripts.com/site/scripts/text-ui/exports-and-how-to-use.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
