đ ī¸Configuration
Last updated
Last updated
Game ID: circuit
A puzzle-based minigame where players must complete electrical circuits by connecting nodes and paths.
Game ID: enigma
A sequence-based decryption challenge where players must decode encrypted patterns within a time limit.
Game ID: morse
A communication-based challenge where players must decode morse code messages using dots and dashes.
Game ID: bruteforce
A password cracking simulation where players must break through security systems using various techniques.
Game ID: tuning
A frequency-based minigame where players must tune into the correct frequency or signal.
Config.CommandEnabled = true
Description: Controls whether the test command for minigames is enabled or disabled.
Default: true
Usage: When enabled, allows the use of /startMinigame
command for testing purposes.
When Config.CommandEnabled
is set to true
, you can use the following command:
/startMinigame [minigame] [time]
Parameters:
minigame: The type of minigame to start
Available options: circuit
, enigma
, morse
, bruteforce
, tuning
time: Time limit in seconds (default: 60)
Examples:
/startMinigame circuit 60
/startMinigame enigma 45
/startMinigame morse 30
local result = exports['devhub_hackingMinigames']:startMinigame(minigame, time)
Description: Programmatically start a minigame from another resource.
Parameters:
minigame
(string): The minigame type to start
time
(number): Time limit in seconds
Returns: Boolean indicating success or failure of the minigame
Example Usage:
local success = exports['devhub_hackingMinigames']:startMinigame("circuit", 60)
if success then
print("Player successfully completed the minigame!")
else
print("Player failed the minigame.")
end
To integrate these minigames into your scripts:
Basic Integration:
local result = exports['devhub_hackingMinigames']:startMinigame("circuit", 45)
if result then
-- Player succeeded
-- Grant rewards, continue mission, etc.
else
-- Player failed
-- Handle failure, retry option, etc.
end
Advanced Integration EXAMPLE:
-- Before starting a heist hacking sequence
if PlayerHasHackingDevice() then
local minigameType = GetRandomMinigame() -- Your custom function
local timeLimit = CalculateTimeLimit() -- Based on player skill, etc.
local success = exports['devhub_hackingMinigames']:startMinigame(minigameType, timeLimit)
if success then
TriggerEvent('heist:hackingSuccess')
else
TriggerEvent('heist:hackingFailed')
end
end
Path: html/config.js
window.config = {
soundVolume: 0.5,
};
Description: Controls the volume level for minigame sound effects.
Range: 0.0 to 1.0 (0% to 100%)
Default: 0.5 (50%)