I'd be interested to see how you have it set up at the moment.
You could do something using 5 variables. One would tell you which number you were inputting next (first, second, third, fourth) and the other four would keep the buttons pressed, using nested conditions based on the value of the first number. After you input the fourth number, check all of them to make sure they're correct, and if they're not play the buzzer and set the 'counter' variable back to 1.
Slightly more complicated but fewer variables needed (only 1) would be something like this:
- on start, set variable to [] (you'll need to use the Control Variables - Script for all of this)
- on pressing a button, Call Script to $game_variables[x].push(value of the button pressed)
- if Script: $game_variables[x].size == 4 do the test below
- if Script: $game_variables[x].eql? [5,9,2,3] do unlock, else play buzzer, set variable to []
You could do something using 5 variables. One would tell you which number you were inputting next (first, second, third, fourth) and the other four would keep the buttons pressed, using nested conditions based on the value of the first number. After you input the fourth number, check all of them to make sure they're correct, and if they're not play the buzzer and set the 'counter' variable back to 1.
Slightly more complicated but fewer variables needed (only 1) would be something like this:
- on start, set variable to [] (you'll need to use the Control Variables - Script for all of this)
- on pressing a button, Call Script to $game_variables[x].push(value of the button pressed)
- if Script: $game_variables[x].size == 4 do the test below
- if Script: $game_variables[x].eql? [5,9,2,3] do unlock, else play buzzer, set variable to []
Last edited by a moderator:

