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