# TextUI

<details>

<summary>Preview</summary>

<img src="https://1100044979-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6IG4qpnsvwJ4tB5edczg%2Fuploads%2FSTbfu7Olz5pDdMsbflbl%2Ftextui_preview.png?alt=media&#x26;token=e58e9fa4-8c56-4908-ace9-1642dc8d7a8e" alt="" data-size="original">

</details>

## MSK.TextUI.Show

Show the TextUI

<mark style="color:red;">**Parameters**</mark>\
**key** - `string` - The key that needs to be pressed\
**text** - `string` - Text\
**color** - `string` - Color as hex - **Optional**, default: `'#5eb131'`

```lua
MSK.TextUI.Show(key, text, color)

-- Example 1: default color
MSK.TextUI.Show('E', 'Press ~g~E~s~ to interact')

-- Example 2: specific color
MSK.TextUI.Show('E', 'Press ~g~E~s~ to interact', '#5eb131')

-- As an Export:
exports.msk_core:ShowTextUI(key, text, color)
```

## MSK.TextUI.ShowThread

Show the TextUI in a thread

<mark style="color:red;">**Parameters**</mark>\
**key** - `string` - The key that needs to be pressed\
**text** - `string` - Text\
**color** - `string` - Color as hex - **Optional**, default: `'#5eb131'`

```lua
MSK.TextUI.ShowThread(key, text, color)

-- Example
CreateThread(function()
    while true do 
        local sleep = 250
        local distance = #(MSK.Player.coords - vector3(572.04, 2724.34, 42.05))

        if distance <= 2.5 then
            sleep = 0
            MSK.TextUI.ShowThread('E', 'Press ~g~E~s~ to interact')
        end

        Wait(sleep)
    end
end)

-- As an Export:
exports.msk_core:ShowTextUIThread(key, text, color)
```

## MSK.TextUI.Hide

Hide the TextUI

```lua
MSK.TextUI.Hide()

-- As an Export:
exports.msk_core:HideTextUI()
```

## MSK.TextUI.Active

Check if the TextUI is active

<mark style="color:green;">**Returns**</mark>\
**isActive** - `boolean` - whether the TextUI is active

```lua
local isActive = MSK.TextUI.Active()

-- As an Export:
local isActive = exports.msk_core:TextUIActive()
```
