Having a safe combination

How would you make it so a chest would have to have a certain combination of numbers like 0042 and then open when

the player puts those numbers in???

is it a scripting thingy or can you do it with simple commands???

Please help
I believe there is an 'Input Number' Event command.
You would use this to store the number in a variable then have a Conditional Branch which checks whether it is '0042' or not.
 
Edit: Like this:
 
x_65.png
Pure and basic eventing:


Input number command into a variable, followed by a conditional branch to check the value.


If you're new to RM, I suggest you follow the link in my signature and work through the tutorials listed there.
Thanks. I feel kinda dumb for not seeing that...
Thanks. I feel kinda dumb for not seeing that...
It's alright. Everyone is a beginner at some point 🙂

I can remember when I didn't know how to do that 😉
Thanks. I feel kinda dumb for not seeing that...
There is so much stuff, everyone can overlook something.

It even sometimes happens to me. 😛
I believe there is an 'Input Number' Event command.

You would use this to store the number in a variable then have a Conditional Branch which checks whether it is '0042' or not.
There's a few potential issues with this system that I can see, and another method to do this that allows you to have passwords be letter or numbers and used in a variety of situations.

There are two issues with the way you have it set up. First is that, since at no point does the variable get reset, whatever numbers you input remain if you fail and go to input again.

The second is, you cannot have a 0 as the first number in your sequence with this method, ever.

[IMG]http://i.imgur.com/D35n364.png[/IMG]

Setting it up this way resets the variable, but still doesn't allow for a 0 to be the first number.

The alternate way I present below requires you to have an blank actor to act as a placeholder for a variable you'll set to be the name.

So, what happens is, when asked for the password/code it clears the variable than asks for your input.

Then you set up a conditional branch for it being what you're looking for or not.

[IMG]http://i.imgur.com/0LodND0.png[/IMG]

The second method I got from a video by a guy named Despain.

I apologize for not having the images in show tags, I don't know how to use them. =x 
I apologize for not having the images in show tags, I don't know how to use them. =x 
😉

And his method is best to prevent avoidable issues.
You can have leading Zeros (Like 0042)
When the Player enters 0042, it is automatically converted to '42' by the game. So then you check for 42.
And yes, using a Name does work, but I prefer my method for a Safe Combination, and have used both methods in the past.
This method is ideal for what was being asked for:

How would you make it so a chest would have to have a certain combination of numbers like 0042 and then open when
the player puts those numbers in???
 
And the numbers should get reset, if you set it up like i did:

Original thread: https://forums.rpgmakerweb.com/threads/having-a-safe-combination.41501/