your code, actually is nearly 'spot on', OurJud !!!!
my edited code with the comments ( '// my comments' ) in the code for you:
if (not HasAttribute(game, "keypadused")) {
game.keypadused = 0
// excellent 'checking' code segment here, advanced thinking if you understand why to do this part! (or did you just copy it from someone else, and not understanding why it is done?)
}
if (game.keypadused = 0) {
PrintCentered ("PLEASE ENTER SECURITY CODE")
}
get input {
if (result="4863") {
UnlockExit (office exit)
PrintCentered ("PASSWORD ACCEPTED, ACCESS GRANTED,")
PrintCentered ("OFFICE DOOR UNLOCKED")
}
else {
// this 'game.keypadused = game.keypadused+1' can't go here, it can't go first before the 'check' (the 'if' Scrit) below
if (3 > game.keypadused) {
PrintCentered ("ACCESS DENIED")
PrintCentered ("You notice a strange sound, like a machine being powered on.")
game.keypadused = game.keypadused + 1
}
else {
PrintCentered ("ACCESS DENIED. BEEEEEEEEP. ACCESS DENIED. BEEEEEEEEP. ACCESS DENIED. BEEEEEEEEP. ACCESS DENIED. BEEEEEEEEP")
PrintCentered ("An alarm sounds. The machine gun starts up. There is no way you can escape in time.")
PrintCentered ("YOU ARE NOW DEAD")
finish
}
}
}
the code however is missing some 'finishing' checks: once you open the door, if you do it again, it'll do the entire thing again, you don't have the 'checks' of 'if door open, if door closed', but this is a bit extra for now, unless you want to add this check into it now (try to guess~do it yourself, and I'll correct you if you did it wrong).
--------
it takes quite some time to get the ordering down and the 'checking' concept down, but you're learning this very quickly! Much moreso than me, hehe!