How do I make a keycard toggle a card reader as active?

a boolean variable should solve that, when you pick the card turn that to true and check the card reader, if its true, ok you can open that.