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