How to make a working passcode

i read that guide (How to make a passcode for a door or a barrier) before, but im trying to make it more interactive (with buttons and stuff), but thanks!