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
The code I’m trying to make is 7 5 3 8, by the way…
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.
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?
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.
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
Click on the counter and click on the property tab.
actually nevermind, I think i just found it —__—
Good to hear! Here’s a useful guide if you want to learn more about properties.
An just to be sure, that blockcode goes into the trigger, and the button and trigger are connected by a wire, right?
Yes.
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.
You mean with and blocks?
Why would we want to do that?
Both ways make sense to me…
I’m not totally sure, but this might save some block code space.
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.
Oh, okay that’s pretty nice.
Oh, the 100/10 and such make sure the numbers are in the right spot. Genius!