Trigger
To use the script simply call the following trigger from any script. For example, if it is a safe robbery script you can run it at the moment of unlocking the safe.
Client Side
This trigger starts the minigame and returns the result:
| Name | Type | Description |
|------------|--------|------------------------------------------------------------------|
| game | string | Options: lockpick, digital, cable, combination or oscilloscope |
| difficulty | string | Options: easy, medium, high |
Example Usage
TriggerEvent("bit-unlock:start", game, difficulty, function(success)
if success then
print("Digital success")
else
print("Digital failed")
end
end)
Complete Example
Here's a complete example of using the digital minigame with medium difficulty:
-- Trigger the digital minigame
TriggerEvent("bit-unlock:start", "digital", "medium", function(success)
if success then
-- Player successfully completed the minigame
TriggerServerEvent('yourscript:unlockDoor')
ESX.ShowNotification('Door unlocked!')
else
-- Player failed the minigame
ESX.ShowNotification('Failed to unlock!')
end
end)
All Minigame Types
You can use any of these minigame types:
- lockpick - Lock picking minigame with pins
- digital - Digital keypad with sequence memory
- cable - Wire connection puzzle
- combination - Combination lock with sound hints
- oscilloscope - Wave matching challenge
Difficulty Levels
Each minigame supports three difficulty levels:
- easy - Slower speed, more time, easier patterns
- medium - Normal speed and difficulty
- high - Fast speed, less time, complex patterns