Usage
Integrating nn_minigames into Your Script
Quick start
-- In your client script, e.g. when player tries to lockpick a door
if exports['nn_minigames']:lockpick('medium') then
-- Success: open door, give item, etc.
TriggerServerEvent('myscript:server:unlockDoor', doorId)
else
-- Failed or cancelled
print('Lockpick failed')
endexports['nn_minigames']:lockpick('medium', nil, function(success)
if success then
TriggerServerEvent('myscript:server:unlockDoor', doorId)
else
print('Lockpick failed or cancelled')
end
end)Ways to call a minigame
1. Generic: StartMinigame(type, ...)
StartMinigame(type, ...)2. Named exports: StartLockpick, StartHacking, etc.
StartLockpick, StartHacking, etc.3. Short name: lockpick, hacking, reactiontest, etc.
lockpick, hacking, reactiontest, etc.Async vs sync
Mode
How to use
Callback?
Return value
Difficulty and custom config
Examples by use case
Lockpick a door (sync)
Hack a terminal (async)
Cut wires (sync)
Reaction test (e.g. for robbery start)
Button mash (e.g. open crate / struggle)
Dynamic minigame type from config
Minigame type reference
Type string
Short export
Typical use
Other exports
Last updated