Skip to main content

The export shape

Every minigame is exposed as a single export on cc_minigames. Each one takes an options table and returns a boolean.
Every option is optional. Omit anything and the difficulty preset fills it in.

Generic dispatch

For data-driven heists where the minigame is picked at runtime:
Start accepts the same name strings as the /minigame command — see the reference table for the full list.

Blocking semantics

Exports yield the calling coroutine until the player finishes or cancels. Always call them from inside CreateThread or another already-yielding context. Calling at the top level of a script body will error.

Concurrency

Only one minigame can run per client at a time.
  • Starting a second while one is active returns false without showing UI.
  • On resource stop mid-game, any outstanding promise resolves false and NUI focus is released so the player is never stuck.

Player input

  • Escape cancels any running minigame and returns false.
  • The resource owns NUI focus while a game is up. It is restored automatically on finish, cancel, or resource stop.
  • Every direct player input (clicks, keypresses) plays a click SFX. Boot/success/fail SFX play automatically.

Variants

Each game declares which visual variants make sense for it: See per-game restrictions in the reference table.

Difficulty

Every game accepts difficulty = 'easy' | 'medium' | 'hard' (default medium). Difficulty drives sane defaults for every other knob — you only need to override individual options when you want a tier-off-tier feel (“hard, but with more attempts than the preset”). The one exception is Fishing, which uses rarity tiers (commonlegendary) instead of difficulty.

Generic options that work everywhere

These two options are not minigame-specific; they’re handled by the shell on every call.

Generic API