How do you make a combination lock for a safe?

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

Ngl, that looks nastier than I thought.

Conceptually, it makes more sense to me though.

2 Likes

Block code tends to do that :frowning:

1 Like

How unfortunately unfortunate. :[

1 Like