As an example, have an 'Unlocked' variable set to 0, where upon being set to 4 it opens the door. When each button is correctly clicked in a sequence add 1 to 'Unlocked' for each button pressed so that when 4 buttons are pressed in sequence the door will open. If they do not click the correct button in a sequence reset 'Unlocked' to 0 etc.