oh no..another problem again..hmmmmnn..
my code now looked like this:

Code:
if(froze == 1)
{
 set(my, PASSABLE);
 set(my, UNLIT | BRIGHT  | PASSABLE);   
 my.skin = 2;
 my.lightrange = 200;
 my.ambient = 100;
 my.blue = 200;

 while (vec_dist(player.x, my.x) > 80)  // wait until the player comes close
 {
   wait (1);
 }
 set(my, INVISIBLE);

 wait(-15);
 reset(my, INVISIBLE);
 froze = 0;
 my.skin = 1;
 my.lightrange = 0;
 my.ambient = 0;
 my.state = 0;
}



the ghosts freezes but if they are not eaten after 15 sec, they are still not moving. i think the problem is in the while because the rest of the lines under it is not terminated. frown