> For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.0resmon.org/0resmon/frkn-resources/frkn-minigame-pack/letter-minigame.md).

# Letter Minigame

#### Letter Finding Game Minigame Documentation

This documentation explains the usage and general features of the "Letter Finding Game" minigame designed for FiveM.

#### What is the Letter Finding Game?

The "Letter Finding Game" is a minigame where players must find and select random letters within a given time frame. Players succeed by selecting the correct letters. If they run out of time or make an incorrect selection, the game ends.

**Key Features:**

* **Timed Game**: Players are given a certain amount of time to find the correct letters.
* **Success/Failure Condition**: The game is completed when the correct letters are found. If time runs out or a wrong letter is selected, the game is lost.
* **Keyboard Simulation**: The game allows players to interact by selecting letters using a simulated keyboard.

#### Export Usage

This minigame can be easily integrated into other systems via an export function.

**Export Definition:**

```lua
luaKodu kopyalaexports('letterGame', letterGame)
```

**Parameters:**

* **callback** (function): The function to be called when the game finishes.
* **duration** (integer): The total time for the game (in seconds).
* **header** (string): The text displayed in the game header.
* **text** (string): The description or instructions for the game.
* **speed** (integer): Determines the game’s speed.

**Command Example:**

```lua
RegisterCommand("lettertest", function()
    exports['frkn-lettergame']:letterGame(function(status)
        if status then
            TriggerEvent("chatMessage", "SYSTEM", "error", "You completed the minigame!")
        else
            TriggerEvent("chatMessage", "SYSTEM", "error", "You failed the minigame!")
        end
    end, 10, "Test", "This is a test", 1.0)
end)
```

#### General Information

This minigame can be easily integrated into any FiveM project. The player's goal is to find and select the correct letters within the specified time limit. Players can trigger the minigame via commands and receive success or failure feedback based on their performance.

To use the minigame in your project, simply call the game using the export function mentioned above.


---

# 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.0resmon.org/0resmon/frkn-resources/frkn-minigame-pack/letter-minigame.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.
