How to connect objects to control

Uhm yeah i mean like how i do it ingame at live time? Like the player nees to connect the door with the keypad you know? Then when i wanr t multiple actors i just add more variables rightt?