Help for making an "order-pressed" minigame?

Forgive me if this isn't the best place to put this question, but could I get a bit of help in figuring out how to do this?

I basically have a set of instructions that the player needs to follow in order to turn a machine on. Here's the list:

1.Red Switch in Maintenance Room
2.Enter Maintenance Code on Main Machine
3. Green Switch in Maintenance room
4. Yellow Switch next to Main Machine

I need the player to have to follow these instructions in the order they're given, and if they do it in the wrong order, then it restarts the mission/progress on turning the machine on.

I'm still kinda new to RPG maker in regards to making minigames like this, so I would appreciate a bit of help. Thank you! 🙂
You'll need to count and check with a variable.

on the first event, you check if the variable is zero when the player hits the red switch.
If yes, you set it to one - if not you set it to zero

on the second event, you check if the variable is one when the code is entered
if yes, you set it to two - if no you set it to zero

on the green switch you check for 2, either setting it to 3 if yes or zero if not
and on the yellow switch you check for 3
Let me ask, at what point do you want the player to know they messed up the order? When they hit the wrong button? Or when they go to check to see if the machine is running? Depending on which kind of changes the way you would do it.
Let me ask, at what point do you want the player to know they messed up the order? When they hit the wrong button? Or when they go to check to see if the machine is running? Depending on which kind of changes the way you would do it.
Probably the moment they hit the wrong button. A sound will play when the player hits the wrong button in the wrong order.
just add the play error sound to the branch that sets the variable to zero in my description above

Original thread: https://forums.rpgmakerweb.com/threads/help-for-making-an-order-pressed-minigame.160693/