Key and door script, python global
ALL CODE COMMENTED !!
Resource?
KeyDictandDoor(Commented).blend (523 KB)