How do you make a combination lock for a safe?

So I’m trying to make a lock for a safe that gives you a key, and what I have so far is some buttons to increase the counters (Kind of like a wheel for the numbers), a reset button (Bottom left button) for all the counters, then an empty enter button (bottom right button) to, hopefully, check if it’s the right code, then give you the key. My problem is that I don’t know A. How to make the counters go to 0 when at 9 then increased; and B. How to check if it is the right code…
Also I have no idea if this picture is going to load correctly lol
Screenshot 2023-08-09 12.35.52 PM

4 Likes

The code I’m trying to make is 7 5 3 8, by the way…

1 Like

1: Make the counters’ target values 10 and connect them to one wire repeater each so they are triggered when the target value is reached. Make the wire repeaters reset the value of their corresponding counters via a wire.

1 Like

2: Make each counter track a separate property (Like Code 1, Code 2, etc.) Place 4 property devices and set them to the properties you put in the counter (The first property device is set to Code 1, the second is set to Code 2, etc.) Set “Property Type” to “Number.”
Have a seperate button that you can use to check if the combination is correct. Connect the button to a trigger with this blockcode:


You can use the channel for whatever you want to do after the lock unlocks. You know how to use channels right?

5 Likes

Yea, I can connect the trigger to an item granter, giving you they key, and I think I could also make it so that another trigger, after the item is granted, will send a channel that teleports you back to the safe, where one of the two teleporters are.

2 Likes

But I have like never really used anything about properties (Yikes), so how do you make the counters track a property? Is it just by wires, or channels? I get the part where you hook up the button to the trigger, with that blockcode, I am just confused on the properties and counters part, cause the properties are where it gets too big brain for me

1 Like

Click on the counter and click on the property tab.

1 Like

actually nevermind, I think i just found it —__—

1 Like

Good to hear! Here’s a useful guide if you want to learn more about properties.

3 Likes

An just to be sure, that blockcode goes into the trigger, and the button and trigger are connected by a wire, right?

2 Likes

Yes.

2 Likes

Hey @NavyCatZ,

What if instead of checking every individual number (First check A, then B, then C, then D), we check in a different way (1000A +100B +10C + 1D), and if the resulting number equals some arbitrary number, then the lock is unlocked.

2 Likes

You mean with and blocks?

2 Likes

Why would we want to do that?

2 Likes

Both ways make sense to me…

2 Likes

I’m not totally sure, but this might save some block code space.

2 Likes

It would take less blocks.

All you would have to check is

If: ((100 times A) + (10 times B) + (C) ) = DEF

Imagination

Where DEF is the code, and A, B and C are the numbers you can put in.

3 Likes

Oh, okay that’s pretty nice.

3 Likes

Oh, the 100/10 and such make sure the numbers are in the right spot. Genius!

4 Likes


I’m pretty sure this saves a block, but not totally.

2 Likes