Skip to content

np_minigames v1.2.0 ​

Every minigame of the np_* resources in one resource: 19 games for hacking, breaching, timing, control, sport and search. Each game is judged by a server-side replay, can be played as a team, and can be practised in an arcade with leaderboards, on screen or in the phone. Any resource starts any game with one export call and can trust the result.

It uses the Nimbus UI look of np_hud and np_phone: frosted grey glass, glossy squircle tiles, white Quicksand, and colour only where it means something (green zone, red heat, white = perfect). It runs on es_extended, qbx_core or qb-core, or standalone; the framework is only used for names and identifiers. There is no hard dependency: oxmysql (stats and leaderboards), an inventory (opts.item), np_admin and the np_* siblings are all optional and detected at start. No ACE anywhere.

Practice arcade

Hex hack (np_banking) Thermite (np_banking)
Hex hack Thermite
Skill ring (np_prison) Torque check (np_mechanic)
Skill ring Torque check
Lockpick (np_inventory, np_shops, np_vending) Reel (np_fishing)
Lockpick Reel
Arcade with Liquid Glass German
Liquid Glass German

Arcade app in np_phone

The game and arcade screenshots are in-game captures at 1920 × 1080 from a local ESX dev server, each game in its opening state. The phone gallery comes from the browser mock (see Development). The UI ships in English and German.

Games ​

Category Games
Hacking Hex hack hexhack · Pattern lock pattern · Code cracker crack
Breach Thermite thermite · Drill drill · Lockpick lockpick · Wires wires · Battering ram ram
Timing Skill ring skillcheck · Torque check torque · Power meter power · Strike strike
Control Balance balance · Reel reel
Sport Swing meter swing · Putting putt · Steady aim sway · Cue stroke stroke
Search Wand sweep sweep

Every game has four difficulties, and any param can be overridden per call. See Games & difficulty.

At a glance ​

  • Server-validated by replay. The puzzle is made from a seed. The NUI sends back only what the player did (picks, press times, holds, input events), and the server replays it with the same rules. The client never sends "I won". See Security.
  • Server-clock timing checks: a win faster than the fastest fair solve × 0.8 is refused (too_fast), a hard cap (timeout), the answer's clock may not run ahead of the server's (clock), a start timeout, an optional maxMove, one session per player and a rate limit on every call.
  • Same rules in Lua and TypeScript. The game files run on the server, the client and in the tests; each NUI game has a TypeScript port of the rules, and parity tests check both give the same verdict.
  • Four difficulties per game, tunable everywhere: per call (clamped to the param's range), per server in Config.Games, and a global time and window scale.
  • Assist, an accessibility option: a player setting for wider windows and more time. The server decides whether it is allowed, and whether it also applies outside the arcade.
  • Team games (generalised from the Pacific sync hack): everyone solves at once and must finish within window seconds of each other, with a status strip of every member's progress.
  • Chains: several games in a row (thermite → hexhack → wires), stopping at the first failure.
  • Profiles + receipts for flows that run on the client: the server registers what must be played, the client plays it, the server checks a one-time receipt bound to the player. A forged "success" doesn't work. See Profiles, items & progress.
  • Items: opts.item refuses a start without the item (no_item) and uses it up by rule and chance, or wears it down. np_inventory, ox_inventory, qb-inventory or the framework.
  • ox_lib drop-in: SkillCheck(difficulty, inputs) takes the same arguments as lib.skillCheck.
  • Practice arcade (/minigames) and the Arcade app in np_phone: every game as a tile, a difficulty picker, personal stats, a top 10 per game and settings for Assist, reduced motion and sounds. See Arcade & phone app.
  • np_admin: live settings, permission nodes, a Send a minigame staff tool, logs of implausible answers and perfect streaks, and the central server theme (brand colour, strength, frosted or Liquid Glass).

How it works ​

  • A game is a pure function of (seed, params, input). make(params, rng(seed)) builds the puzzle, the NUI plays it and verify(puzzle, answer) replays the answer on the server. Hidden state (solution paths, the fish's behaviour, sweet spots) comes from the seed.
  • Two modes. Server exports start an authoritative session: the server builds, times and judges it. Client exports start a local session that is judged on the client: fine for crafting, emotes and other low-stakes gates, never for anything that pays out.
  • The resources keep their own checks. np_minigames adds its replay, timing and position checks on top. Tokens, distance, items they own, loot and cooldowns stay with the calling resource.
  • Optional for everyone. Every np_* resource that uses np_minigames keeps its own built-in minigame when np_minigames is not started, and has a config switch to turn the integration off. See Integrations.

Quick example ​

lua
-- server: validated, blocks until the game ends
local ok, result = exports.np_minigames:Play(src, 'thermite', { difficulty = 'hard', label = 'Back door', maxMove = 2 })
if ok then OpenDoor() end

-- two players, one round, finish within 6 s of each other
local ok, team = exports.np_minigames:Team({ a, b }, 'hexhack', { window = 6 })

-- needs a lockpick, loses it on a fail one time in three
local ok, result = exports.np_minigames:Play(src, 'lockpick', { item = { name = 'lockpick', remove = 'fail', chance = 0.35 } })

-- client: a local flavour gate (ox_lib style)
if exports.np_minigames:SkillCheck({ 'easy', 'medium' }, { 'e' }) then ... end

Next steps ​