Returns true if the player won, false if they lost or timed out. The function yields until the minigame ends.
cancelSession()
Aborts the minigame currently in progress — useful when the player walks away, is interrupted, or the calling resource needs to bail out. The active session cleans up its animation and props, and the original start*Session call returns false. No-op if nothing is running.
exports['mbt_minigames']:cancelSession()
A player dying mid-minigame is detected automatically and ends the session the same way — you don't need to call this on death.
Overridable params Keys by Type
hacking
Key
Type
Description
sequenceLength
number
Number of codes to click (4–8)
maxMistakes
number
Wrong clicks allowed before failure
wire_fix
Key
Type
Description
wireCount
number
Number of wires to route (4–6)
bolt_turn
Key
Type
Description
boltCount
number
Number of bolts to tension (3–5)
heatSpeed
number
Heat build rate multiplier
maxMistakes
number
Overheat events allowed before failure
code_match
Key
Type
Description
segmentCount
number
Codes to match (6–10)
shiftSpeed
number
Milliseconds between stream shifts
maxMistakes
number
Missed codes allowed before failure
Animation Override
Both exports accept a custom animation table. You can override the entire animation or specific fields:
exports['mbt_minigames']:startRepairSession({ type = "hacking", animation = { Dict = "anim@heists@ornate_bank@hack", Enter = "hack_enter", Loop = "hack_loop", Exit = "hack_exit", EnterTime = 1500, Props = { { Model = "hei_prop_hst_laptop", Bone = 28422, Offset = vector3(0,0,0), Rot = vector3(0,0,0) }, },
Pass animation = false to skip the animation entirely (minigame opens immediately without ped animation).
Debug Commands
Available only when MBT.Debug = true in config.lua.
Command
Description
/testminigame [type] [difficulty]
Open any minigame directly in-game
/testscene [type]
Play the animation sequence only (15 seconds), no game