Skip to content

Client Exports

Start

lua
local success = exports["prp-minigames"]:Start(gameName, gameOptions, otherOptions)

Starts playing minigame with specified options. Returns success as boolean.

  • gameName: string - name of the minigame. See Minigames.
  • gameOptions: table | nil - options related to minigame itself. See Minigames.
  • otherOptions: OtherOptions? - options related to animations played on player during minigame.
lua
---@class OtherOptionAnimation
---@field scenario string? Name of scenario
---@field name string? Name of animation
---@field dict string? Animation dictionary
---@field flag number? Animation flag

---@class OtherOptions
---@field cursor boolean? Defines if cursor should be visible while minigame plays
---@field onTick function? It's triggered every tick when minigame runs
---@field animation OtherOptionAnimation

Stop

lua
exports["prp-minigames"]:Stop()

Stops playing minigame.

IsPlaying

lua
local isMinigame = exports["prp-minigames"]:IsPlaying()

Returns if any minigame is currently playing as boolean.

Client callbacks

lua
local success = lib.callback.await("prp-minigames:startMinigame", src, gameName, gameOptions, otherOptions)

Returns success as boolean.

  • gameName: string - name of the minigame.
  • gameOptions: table | nil - options related to minigame itself.
  • otherOptions: table | nil - options related to animations played on player during minigame.