# Minigame `[Client]`

A module to run interactive minigames in your scripts.

## JO Functions

### jo.minigame.cancel()

Cancels the currently running minigame. <br>

#### Syntax

```lua
jo.minigame.cancel()
```

#### Return Value

Type : _boolean_

---

### jo.minigame.lockpick()

Starts the lockpick minigame. <br>

#### Syntax

```lua
jo.minigame.lockpick(config)
```

#### Parameters

`config` : _table_ `[Optional]`

> The lockpick configuration
>

> `config.pins` : _integer_ - Number of lockpicks available before failure; default: 1 `[Optional]`
> 
> `config.pinHealth` : _integer_ - Health of each lockpick; default: 100 `[Optional]`
> 
> `config.pinDamage` : _integer_ - Damage applied when forcing the lock at a wrong angle; default: 20 `[Optional]`
> 
> `config.pinDamageInterval` : _integer_ - Minimum delay in milliseconds between two damage ticks; default: 150 `[Optional]`
> 
> `config.solvePadding` : _number_ - Angle tolerance in degrees around the correct position; default: 4 `[Optional]`
> 
> `config.maxDistFromSolve` : _number_ - Maximum angle distance used to calculate cylinder allowance; default: 45 `[Optional]`
> 
> `config.cylRotSpeed` : _number_ - Cylinder rotation speed per tick while pushing; default: 3 `[Optional]`
> 
> `config.onPinBroken` : _function_ - Called each time a lockpick pin breaks `[Optional]`
> 
> `config.animPostFx` : _string|false_ - AnimPostFX effect to play while the minigame is open; default: "PauseMenuIn"; use false to disable `[Optional]`
> 

#### Return Value

Type : _"success"|"failed"|"canceled"|"busy"_

---

### jo.minigame.qte()

Starts the QTE minigame. <br>

#### Syntax

```lua
jo.minigame.qte(config)
```

#### Parameters

`config` : _table_ `[Optional]`

> The QTE configuration
>

> `config.roundCount` : _integer_ - Number of QTE rounds to complete; default: 4 `[Optional]`
> 
> `config.allowedKeys` : _string[]_ - Allowed keys; default: A-Z `[Optional]`
> 
> `config.rotationCount` : _integer_ - Number of full indicator rotations allowed per round; default: 1 `[Optional]`
> 
> `config.targetStartAngle` : _table_ - Target segment start angle range in degrees `[Optional]`
> 
> > `config.targetStartAngle.min` : _number_ - Minimum target start angle; default: 100 `[Optional]`
> > 
> > `config.targetStartAngle.max` : _number_ - Maximum target start angle; default: 300 `[Optional]`
> > 
> `config.targetArcSize` : _table_ - Target segment size angle range in degrees `[Optional]`
> 
> > `config.targetArcSize.min` : _number_ - Minimum target size; default: 50 `[Optional]`
> > 
> > `config.targetArcSize.max` : _number_ - Maximum target size; default: 60 `[Optional]`
> > 
> `config.rotationDuration` : _table_ - Full rotation duration range in milliseconds `[Optional]`
> 
> > `config.rotationDuration.min` : _integer_ - Minimum duration; default: 2000 `[Optional]`
> > 
> > `config.rotationDuration.max` : _integer_ - Maximum duration; default: 3000 `[Optional]`
> > 
> `config.introDelay` : _integer_ - Delay in milliseconds before the indicator starts after the intro animation; default: 200 `[Optional]`
> 
> `config.successDelay` : _integer_ - Delay in milliseconds before continuing after a successful round; default: 450 `[Optional]`
> 
> `config.failureDelay` : _integer_ - Delay in milliseconds before closing after a failed round; default: 550 `[Optional]`
> 
> `config.roundDelay` : _integer_ - Delay in milliseconds between a successful round and the next intro; default: 100 `[Optional]`
> 
> `config.animPostFx` : _string|false_ - AnimPostFX effect to play while the minigame is open; default: "PauseMenuIn"; use false to disable `[Optional]`
> 

#### Return Value

Type : _"success"|"failed"|"canceled"|"busy"_
