Usage Guide

Integrate mini-games into your FiveM server.

Installation

Download zh_minigame from the repository, place the folder anywhere in your server's resources directory, then add to server.cfg:

ensure zh_minigame

Configuration

In config.lua, list the mini-game slugs available on your server:

Config = {
    games = {
        "lockpick",
        "wire",
        "memory"
    }
}

Each slug matches a game created on the web app — e.g. a project at /lockpick becomes "lockpick" in the list.

Usage

Call the export from any resource to start a game:

local completed = exports['zh_minigame']:StartMinigame("lockpick")

if completed then
    print("Player won!")
else
    print("Player failed or cancelled.")
end

StartMinigame blocks until the player finishes — returns true on success, false on failure or if the game slug is invalid.

Creating Games

  1. Click Create on the homepage to start from a blank template.
  2. Use the AI Assistant to generate code — describe any mini-game.
  3. Edit code in the built-in editor and preview live.