# skill check

## Skill Check

<figure><img src="https://share.lvsoft.com.ar/images/Z4vKc.jpg" alt=""><figcaption></figcaption></figure>

***

### How to use:

Client-side using exports

### skillCheck

Runs a skill check with the defined difficulty.

```
exports.lvs_lib:skillCheck(difficulty, inputs)
```

* difficulty: `'easy'` or `'medium'` or `'hard'` or `table`
  * Preset difficulties:
    * 'easy' - `{ areaSize: 50, speedMultiplier: 1 }`
    * 'medium' - `{ areaSize: 40, speedMultiplier: 1.5 }`
    * 'hard' - `{ areaSize: 25, speedMultiplier: 1.75 }`
  * Custom difficulties can be set by sending an object instead of one of the preset strings above
    * areaSize: `number`
      * Size of the success area in degrees
    * speedMultiplier: `number`
      * Multiplier for the speed of the indicator
* inputs?: `string[]`
  * A random key will be picked from the inputs table for each skill check
  * If no inputs are defined the key is defaulted to `e`

***

### skillCheckActive <a href="#libskillcheckactive" id="libskillcheckactive"></a>

Returns true if a skill check is currently active.

```
exports.lvs_lib:skillCheckActive()
```

***

### cancelSkillCheck <a href="#libcancelskillcheck" id="libcancelskillcheck"></a>

Cancels the currently ongoing skill check.

```
exports.lvs_lib:cancelSkillCheck()
```

***

### Usage Example <a href="#usage-example" id="usage-example"></a>

```
local success = exports.lvs_lib:skillCheck(
    {
        'easy', 
        'medium',
        {areaSize = 60, speedMultiplier = 2}, 
        'hard'
    }, {'w', 'a', 's', 'd'}
)

print(success)
```

<br>


---

# 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://fivem.lvsoft.com.ar/qb-esx/lvs-lib/skill-check.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.
