there is a huge problem in this whole thing, and that is this part:

Code:
my.emask |= ENABLE_SCAN; 
    my.event = scan_event;
	
	while(my.skill3==1) {
  		my.pan+=3;
  		wait(1);
	}


the engine is not going to wait until skill3 is 1, the engine sets the events for the door, then IMMEDIATELY checks if skill3 equals 1 and as it doesn't, it skips the while-loop and ends the action. What you need to do, is to do another kind of loop, or a second loop that sets the action to a wait state as long as skill3 is not 1:

Different loop example:
Code:
my.emask |= ENABLE_SCAN; 
my.event = scan_event;
	
while(me)
{
   if(my.skill3==1)
   {
      my.pan+=3;
   }
   wait(1);
}


or the (worse) alternative, the complimentary loop:
Code:
my.emask |= ENABLE_SCAN; 
my.event = scan_event;

while(my.skill3 != 1){ wait(1); }

while(my.skill3==1) 
{
   my.pan+=3;
   wait(1);
}


hope I could help


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku