> For the complete documentation index, see [llms.txt](https://usin.gitbook.io/usin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://usin.gitbook.io/usin/free/usin-or-thoughts.md).

# USIN | Thoughts 💬

USIN Thoughts is a standalone FiveM resource that adds immersive "thought/inner monologue" notifications to your server. It features a sleek typewriter effect, customizable styles, and a built-in

## Features

* **Immersive Notifications**: Display thoughts or inner monologues with a smooth typewriter animation.
* **Highly Customizable**:
  * **Visuals**: Change fonts, colors, backgrounds, borders, and shadows.
  * **Positioning**: Move the notification to various screen positions (Top, Bottom, Center, etc.).
  * **Timing**: Adjust typing speed, display duration, and fade-out time.
* **In-Game Settings Menu**: Players can adjust their preferences on the fly using the settings command or keybind.
* **Sound Effects**: Optional typing or popup sounds (configurable).
* **Standalone**: Works with any framework (ESX, QBCore, ox\_core, etc.) or no framework at all.

## Installation

1. Collect `usin_thoughts` for free from my [Tebex](https://usin.tebex.io/category/free).
2. Download the `usin_thoughts` resource from the [Cfx.re Portal](https://portal.cfx.re/assets/granted-assets).
3. Place the `usin_thoughts` folder into your server's `resources` directory.
4. Add `ensure usin_thoughts` to your `server.cfg`.

## Usage

### Commands

* `/thought [text]`: Displays a thought with the specified text.
  * Example: `/thought I wonder if I left the stove on...`
* `/thought_settings`: Opens the settings menu to customize the appearance and behavior.

### Keybinds

* **Settings Menu**: You can configure a default keybind in `config.lua` (default is usually disabled or set to a specific key). Players can also map this in their GTA V Keybind settings under "FiveM".

### Exports (For Developers)

You can trigger thoughts from other scripts using the client-side export or server-side event.

**Client-Side Export:**

```lua
exports['usin_thoughts']:show(text, duration, style)
```

* `text` (string or table): The message to display. If a table is provided, a random string from the list will be chosen.
* `duration` (number, optional): How long the message stays on screen in milliseconds.
* `style` (table, optional): Override specific style properties for this message.

**Server-Side Event:**

```lua
TriggerClientEvent('usin_thoughts:show', targetId, text, duration, style)
```

**Server-Side Export:**

```lua
exports['usin_thoughts']:send(targetId, text, duration, style)
```

* `targetId`: The ID of the player to show the thought to (-1 for all players).

## Configuration

Check `config.lua` for global defaults:

* **General**: Display duration, typing speed.
* **Visual**: Default position, font styles, colors.
* **Caption**: "Thoughts:" prefix text and style.
* **Sound**: Enable/disable sound and volume.

## Preview

<details>

<summary>GIFs:</summary>

<figure><img src="https://3313543074-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv35OSwS15FeJ53pmKPmN%2Fuploads%2FM1MjXyjPS9Vf8iBDfsC7%2Fut-g-b.gif?alt=media&amp;token=209b4dcd-4e82-487a-a0d3-828f6f16cd5c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3313543074-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv35OSwS15FeJ53pmKPmN%2Fuploads%2F26CZJf9vOtuHgAlMpLMP%2Fut-g-m-e.gif?alt=media&amp;token=fba60272-06c7-468e-8d0b-ff67a0d3ea5f" alt=""><figcaption></figcaption></figure>

</details>

### Video:

{% embed url="<https://youtu.be/n1vsS8qns1s>" %}

## Support

* **Discord** (recommended): [`https://discord.gg/ypKjw6ynND`](https://discord.gg/ypKjw6ynND) (open a ticket)
* **Email**: `usin.tebex@gmail.com` (It's a possability that I won't respond, simply because I don't check it very often.)
