From the reference libraryRedM

autodoc_client_functions

jo_libs/modules/minigame/autodoc/autodoc_client_functions.md

autodoc_client_functions

JO Functions > jo.minigame.cancel()

Cancels the currently running minigame. <br>

JO Functions > jo.minigame.cancel() > Syntax

jo.minigame.cancel()

JO Functions > jo.minigame.cancel() > Return Value

Type : boolean

JO Functions > jo.minigame.cancel() > Example

CreateThread(function()
  -- Cancel the running minigame after 5 seconds
  Wait(5000)
  local canceled = jo.minigame.cancel()
  print(canceled)
end)

-- Start a minigame that can be canceled from another thread
local result = jo.minigame.lockpick()
print(result)


JO Functions > jo.minigame.lockpick()

Starts the lockpick minigame. <br>

<video controls muted loop class="preview"> <source src="/videos/lockpick.webm" type="video/webm"> </video>

JO Functions > jo.minigame.lockpick() > Syntax

jo.minigame.lockpick(config)

JO Functions > jo.minigame.lockpick() > Parameters

config : table <BadgeOptional />

The lockpick configuration

config.pins : integer - Number of lockpicks available before failure; default: 1 <BadgeOptional />

config.pinHealth : integer - Health of each lockpick; default: 100 <BadgeOptional />

config.pinDamage : integer - Damage applied when forcing the lock at a wrong angle; default: 20 <BadgeOptional />

config.pinDamageInterval : integer - Minimum delay in milliseconds between two damage ticks; default: 150 <BadgeOptional />

config.solvePadding : number - Angle tolerance in degrees around the correct position; default: 4 <BadgeOptional />

config.maxDistFromSolve : number - Maximum angle distance used to calculate cylinder allowance; default: 45 <BadgeOptional />

config.cylRotSpeed : number - Cylinder rotation speed per tick while pushing; default: 3 <BadgeOptional />

config.onPinBroken : function - Called each time a lockpick pin breaks <BadgeOptional />

config.animPostFx : string|false - AnimPostFX effect to play while the minigame is open; default: "PauseMenuIn"; use false to disable <BadgeOptional />

JO Functions > jo.minigame.lockpick() > Return Value

Type : "success"|"failed"|"canceled"|"busy"

JO Functions > jo.minigame.lockpick() > Example

-- Start a lockpick minigame with custom difficulty settings
local result = jo.minigame.lockpick({
  pins = 3,
  pinHealth = 100,
  pinDamage = 25,
  solvePadding = 5,
  -- Called each time one lockpick breaks
  onPinBroken = function()
    print("A lockpick broke")
  end
})

-- Handle the final minigame status
if result == "success" then
  print("Lock opened")
elseif result == "failed" then
  print("Lockpick failed")
elseif result == "canceled" then
  print("Lockpick canceled")
end


JO Functions > jo.minigame.qte()

Starts the QTE minigame. <br>

<video controls muted loop class="preview"> <source src="/videos/qte.webm" type="video/webm"> </video>

JO Functions > jo.minigame.qte() > Syntax

jo.minigame.qte(config)

JO Functions > jo.minigame.qte() > Parameters

config : table <BadgeOptional />

The QTE configuration

config.roundCount : integer - Number of QTE rounds to complete; default: 4 <BadgeOptional />

config.allowedKeys : string[] - Allowed keys; default: A-Z <BadgeOptional />

config.rotationCount : integer - Number of full indicator rotations allowed per round; default: 1 <BadgeOptional />

config.targetStartAngle : table - Target segment start angle range in degrees <BadgeOptional />

config.targetStartAngle.min : number - Minimum target start angle; default: 100 <BadgeOptional />

config.targetStartAngle.max : number - Maximum target start angle; default: 300 <BadgeOptional />

config.targetArcSize : table - Target segment size angle range in degrees <BadgeOptional />

config.targetArcSize.min : number - Minimum target size; default: 50 <BadgeOptional />

config.targetArcSize.max : number - Maximum target size; default: 60 <BadgeOptional />

config.rotationDuration : table - Full rotation duration range in milliseconds <BadgeOptional />

config.rotationDuration.min : integer - Minimum duration; default: 2000 <BadgeOptional />

config.rotationDuration.max : integer - Maximum duration; default: 3000 <BadgeOptional />

config.introDelay : integer - Delay in milliseconds before the indicator starts after the intro animation; default: 200 <BadgeOptional />

config.successDelay : integer - Delay in milliseconds before continuing after a successful round; default: 450 <BadgeOptional />

config.failureDelay : integer - Delay in milliseconds before closing after a failed round; default: 550 <BadgeOptional />

config.roundDelay : integer - Delay in milliseconds between a successful round and the next intro; default: 100 <BadgeOptional />

config.animPostFx : string|false - AnimPostFX effect to play while the minigame is open; default: "PauseMenuIn"; use false to disable <BadgeOptional />

JO Functions > jo.minigame.qte() > Return Value

Type : "success"|"failed"|"canceled"|"busy"

JO Functions > jo.minigame.qte() > Example

-- Start a QTE minigame with custom rounds, keys, and timing
local result = jo.minigame.qte({
  roundCount = 5,
  allowedKeys = { "A", "S", "D", "F" },
  rotationDuration = {
    min = 1500,
    max = 2500
  }
})

-- Handle success, failure, cancel, or busy statuses
if result == "success" then
  print("QTE completed")
else
  print("QTE result: " .. result)
end

Back to documentation