OK this is going to take a while to explain :smile:
Entities = Green Entity names / values = Yellow Entity parameters = Cyan
First off make your buttons (
func_button) of a keypad (1-9) giving them all a name, in this case i'll call them
keypad1,
keypad2,
keypad3 etc...
Set the
target of
keypad1 to
keypad1correct. Set the other
targets of all the other buttons to
keypadwrong.
This may seem strange but im now going to use
trigger_changetarget's for the secequence.
Ok, create two
trigger_changetarget's and call them both
keypad1correct. Have the
target of one as them
keypad1 and the
new target as
keypadwrong, and set the the other one: ([color=cyan]target =
keypad3,
new target =
keypad3onecorrect) ("3one" because we are using two 3's as the correct combination).[/color]
So far we have: Player presses button "1". If he presses any other button nothing happens.
Ok now we need to create the
[color=limegreen]trigger_changetarget[/color] for button 3. For this its very similar , we create another
trigger_changetarget and set the
target =
keypad3 to the
new target =
keypay3twocorrect. Dont forget to name the
trigger_changetarget keypad3onecorrect. Only one change target is used because its only effecting one butting since the code goes 3-3.
So far we have: Player presses button "1" and then "3".
Ok this step is almost the same as the first two
trigger_changetargets's, make them exactly the same except make them change
keypad3's
target to
keypadwrong and change
keypad7's target to
triggerobject (Because its the last button to be pressed).
So far we have: Player presses button "1", "3" and then "3".
Now it gets easier

. (Im assuming you know how to make a
multi_manager, if not theres a tu on here some where).
Make a
multi_mananger called
triggerobject which
targets's the door that you want to open and
keypadwrong all with a time of 0 secs (instant).
Now make 3 more trigger_changetarget's called keypad3. This time they set: (
keypad1 =
keypad1correct,
keypad3 =
keypadwrong,
keypad7 =
keypadwrong).
Right now theres all the other buttons than cancel the process, if you get the code wrong. Just make them all target
keypadwrong! And we are done!
If the player presses "1" then "3" then "3" and finally "7" the
mulit_manager makes the code reset while targeting your door.
I hope this helped. And if anyone notices a problem with this, PLEASE DO SAY.