action door1_act()
{
while(!ball){wait(1);}
var box_move=0;
while(1)
{
if(vec_dist(me.x,player.x)<150 && box_move<500)
{
box_move+=10;
c_move(me,vector(0,-20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
if(vec_dist(me.x,player.x)>150 && box_move>0)
{
box_move-=10;
c_move(me,vector(0,20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
wait(1);
}
}
action door2_act()
{
while(!ball){wait(1);}
var box_move=0;
while(1)
{
if(vec_dist(me.x,player.x)<200 && box_move<500)
{
box_move+=10;
c_move(me,vector(0,20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
if(vec_dist(me.x,player.x)>200 && box_move>0)
{
box_move-=10;
c_move(me,vector(0,-20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
wait(1);
}
}
Like this it crashes, changed player to ball because my player is the ball

And when I started first time, nothing happended... But I'll try it, thakns!