Minigames

Minigames are interactive challenges that players must complete to progress through heist stages. They add skill-based gameplay and increase immersion by simulating real criminal activities such as ha

Using Minigames in Heists

To add a minigame to an interaction point, include the minigame parameter in your interaction configuration:

minigame = { 
    name = 'datacrack',
    speed = 2 -- optional parameters can be added depending on the minigame
}

Each minigame can accept specific parameters to customize difficulty and behavior. These parameters are passed through the minigame table in your configuration.

Available Minigames

The system includes 12 pre-built minigames that can be used immediately in any heist configuration.

'datacrack'

Description: TODO

Parameters:

  • speed: Controls the difficulty/speed of the minigame (higher = harder)

Example Usage:

minigame = { 
    name = 'datacrack',
    speed = 50 -- optional: controls difficulty
}

'blocks'

Description: TODO

Parameters:

  • time: Sets the time limit in seconds

Example Usage:

minigame = { 
    name = 'blocks',
    time = 30 -- optional: time limit in seconds
}

'fingerprint'

Description: TODO

Parameters:

  • time: Sets the time limit in seconds

  • lives: Number of attempts before failure

Example Usage:

minigame = { 
    name = 'fingerprint',
    time = 30, -- optional: time limit in seconds
    lives = 3  -- optional: number of attempts
}

'fingerprint2'

Description: TODO

Parameters:

  • time: Sets the time limit in seconds

Example Usage:

minigame = { 
    name = 'fingerprint2',
    time = 25 -- optional: time limit in seconds
}

'computer'

Description: TODO

Example Usage:

minigame = { name = 'computer' }

'voltage'

Description: TODO

Example Usage:

minigame = { name = 'voltage' }

'keypad'

Description: TODO

Example Usage:

minigame = { name = 'keypad' }

'lockpick'

Description: Simulates picking a lock by manipulating pins inside a lock cylinder.

Example Usage:

minigame = { name = 'lockpick' }

'safecracking'

Description: Simulates cracking a traditional dial safe by finding the correct combination.

Parameters:

  • locks: Array of numbers representing lock positions (defaults to random if not specified)

Example Usage:

minigame = { 
    name = 'safecracking',
    locks = { 42, 69 } -- optional: specific lock positions
}

'small_drill'

Description: Simulates drilling into a small safe or deposit box lock.

Parameters:

  • difficulty: Sets the difficulty level (1-3)

Example Usage:

minigame = { 
    name = 'small_drill',
    difficulty = 2 -- optional: sets difficulty level
}

'big_drill'

Description: Simulates drilling into a large vault door lock.

Example Usage:

minigame = { name = 'big_drill' }

'laser'

Description: TODO

Example Usage:

minigame = { name = 'laser' }

Adding Custom Minigames

The system supports adding custom minigames by editing the minigames.lua file. To create a custom minigame:

  1. Add a new function to the table in minigames.lua

  2. Return a boolean value (true for success, false for failure)

  3. Use the included data parameter to access any custom settings

-- Example custom minigame
example = function(data)
    -- Print all parameters passed from the heist configuration
    print(json.encode(data, {indent = true}))
    
    -- Your minigame logic goes here
    -- Can call other resources, trigger events, etc.
    
    -- Return true for success, false for failure
    return true
end

You can then use your custom minigame in any heist by referencing its name:

minigame = { 
    name = 'example',
    difficulty = 3,
    custom_param = 'value'
    -- Any parameters here will be passed to your function as the data table
}

Accessing Exports

If your minigame needs to use UI elements or game mechanics from other resources, you can access them via exports:

my_minigame = function(data)
    -- Example calling another resource
    return exports['my-resource']:StartMinigame(data.param1, data.param2)
end

Last updated