Enter a code |
This is a method for entering a number code and verifying it.
Create a room with a numberpad with objects for the numberbuttons. In the script of the room you have to define some variables.
on
(enter) { setnum (counter ; 1) setnum (code1 ; 4) setnum (code2 ; 2) setnum (code3 ; 0) setnum (code4 ; 1) } |
The counter variables keeps track on the players inputs. The four code vars are the correct solution. The object scripts of the number buttons should look like this.
on
(click) if_num (input1 ; [code1]
) cutscene
(wrongcode) |
With every click on a button the counter goes up by one and the entered number will be saved. After the fourth number the script will check if the entered code is correct. Depending on that one of two cutscenes will start.