[Release] pd-safe (Standalone LUA safecracking minigame)


How to use

You can create as many locks as you want. It will be generated based on how many random numbers are provided to the createSafe function;
Also, you shall only provide numbers between 0 and 99, otherwise it will be impossible to finish the minigame properly!

local res = exports["pd-safe"]:createSafe({math.random(0,99)})

The final result is returned as soon as the minigame is finished

This code was originally developed in C#. You can access the original repository by clicking on the following link

Sample Video
Download forgot the download link :man_facepalming:



Looks great! :slight_smile:

1 Like

Does it have audio? Like when you turn the dial does it make the ticking sound. If not you should add it.

Very nice. I’m impressed!

1 Like

Yes it does have audio! Sadly I forgot the link, it’s up now!

good release

1 Like

Is this even a safe or is it just a lockpick type thing?

Its a minigame. Just like hacking

how do you check if he managed to open the box or not?

well, turns out im to stupid to set this up, how do i lock a safe?


How do I add 3 locks as shown in the Video. Somewhere I am missing something easy…


Here’s how:

local res = exports[“pd-safe”]:createSafe({math.random(0,99),math.random(0,99),math.random(0,99),math.random(0,99)})

For some reason the script pays out the rewards before the safe combo is cracked.

What is it that is causing it to not “wait” until the mini-game is completed?

Somewhere I need to show script of a “fail” combo crack when they fail it returns fail to server.

Any help, tips or pointer would be very appreciated…esx_holdup (w/o the timer in place = it has been removed to install new mini-game…)

AddEventHandler('esx_advanced_holdup:startRobberingTimer', function(zone)
	isInRobberyZone = true
	isRobberyDone = false
	loopAlarm = true
	local res = exports["pd-safe"]:createSafe({math.random(0,99),math.random(0,99),math.random(0,99),math.random(0,99)})

	TriggerEvent('esx_advanced_holdup:loopAlarmTriggered', zone)

	while Busy and isInRobberyZone do

	Busy = false        

1 Like

That’s because you have basically just plonked it on top of holdup so the initial method of working is still running behind. I have actually nearly finished a robbery script for this that will replace holdup.

Absolutely awesome release!

I just wanted to ask, is it possible to make it that you can press and hold “A” and “D” instead of having to spam press the buttons? Would be cool.

Como adiciono ele a um script tenho que adicionar essa linha ?
local res = exports[“pd-safe”]:createSafe({math.random(0,99)})

no meu script de roubo ? preciso de ajuda

You have to edit the original code to fulfill your requirements, I would give you some hints. Go to the Line 208 in cl_safe.lua, and add TriggerEvent with any name you want which is the end of the minigame and the safeUnlocked value is the value you need to determine whether or not the player succeed the minigame.