Variable check not working for puzzle

Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.

hi,

i’m trying to create a small puzzle where the player has to click switches in the right order, if the switch is right a light turns on and the switch stay up. if the next switch clicked isn’t the right one all of the switches reset.

i managed to get it working with a few variables. each switch would have a variable set to that switches order in the puzzle, and then a variable which would calculate the number needed to be the correct switch. I then set up an event to check if the needed number was not equal to the current number, in which case it would reset the puzzle.

this was working great for a while, but then i added some events to trigger the puzzle when the player interacted with an object, and the next time i tested it, all switches reset immediately even if it is the right one.

This is error proof logic

Bullets go from left to right in order 1 2 3 4

These 2 events i selected have condition called Compare two strings

You can add as many bullets/switches as you want and it would change nothing
Only thing you care is to update SuperSecretOrder
You can even re use bullets
Maybe instead of text object you would wish to go with 2 text variables or hide text object

thanks so much for the help! I’ve put your code in and everything is working great.