
If You want open the door only if the character has the key you can use the(GetGlobalInt(1) == 1) like in my code, where i put the global variable for this purpose. When is equal to 1 that means you have already collect the key and then you can open the door else is equal to 0 and the code is not executed.