How did you call the function? Like this?
Code:
on_e = door_function;


If that was the last function called in your first level, it's possible the key press carried over to the start of your next level. Add these lines to the start of your door function (both doors) and see if it helps
Code:
while(key_e){wait(1);}
//wait for the key to be released before running the function


Last edited by tolu619; 05/27/14 08:04. Reason: Corrected small bit of code