> For the complete documentation index, see [llms.txt](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-minigames/installation.md).

# Installation

## Requirements

* FiveM server artifact **5181 or newer**
* `lua54 'yes'` — already declared in the manifest, no action needed
* No external Lua libraries or framework scripts required

***

## Installation

{% stepper %}
{% step %}

## Add the resource

Drop the `jiffy-minigames` folder into your resources directory. Category folders are fine:

```
resources/
└── [JiffyJrDev]/
    └── jiffy-minigames/
```

{% endstep %}

{% step %}

## Update server.cfg

Add `ensure jiffy-minigames` **before** any script that previously depended on a legacy minigame resource:

```cfg
ensure jiffy-minigames
```

{% hint style="warning" %}
**Order matters.** jiffy-minigames must start before any script that calls into it or relies on a compatibility adapter.
{% endhint %}
{% endstep %}

{% step %}

## Remove legacy resources

Stop the resources that jiffy-minigames is replacing. Do **not** run both at the same time:

```cfg
# Remove or comment out:
# ensure ps-ui
# ensure mhacking
# ensure safecracker
# ensure lockpick
# ensure datacrack
# ensure qb-minigames
```

{% endstep %}

{% step %}

## Add standalone shims (if needed)

Some legacy scripts call their dependencies by export name (e.g. `exports['ps-ui']:Circle(...)`). For those, install the matching shim from the `compat/` folder — it carries the legacy resource name and forwards calls to jiffy-minigames.

Only install shims for the resources you actually removed:

```cfg
ensure jiffy-minigames

# Optional shims — only if the removed resource was called by name via exports:
ensure jiffy-compat-pd-safe
ensure jiffy-compat-utk_fingerprint
ensure jiffy-compat-ultra-keypackhack
```

See [Compatibility Layer](/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-minigames/compatibility.md) for the full list and when shims are needed.
{% endstep %}

{% step %}

## Verify startup

Check the server console after restart:

```
[Jiffy Minigames] Started. Framework: qb | 12 games registered | compat: 8 adapters active
```

{% endstep %}
{% endstepper %}

***

## Your first export call

From any client-side script:

```lua
-- Blocking / promise style (must be inside a thread):
CreateThread(function()
    local success = exports['jiffy-minigames']:Circle({ difficulty = 'medium' })
    if success then
        print('Player passed!')
    end
end)

-- Callback style (works anywhere):
exports['jiffy-minigames']:Lockpick({ difficulty = 'hard', pins = 5 }, function(success)
    if success then
        TriggerServerEvent('my-script:server:unlock')
    end
end)
```

See [API Reference](/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-minigames/api.md) for all exports and the full result object.

***

## Pre-release checklist

Before going live, make sure these two flags are set to `false` in `editable/config.lua`:

```lua
Config.Debug              = false   -- stops verbose console output
Config.EnableTestCommands = false   -- disables /jmg_* commands for players
```
