okay

Here, it's supposed to check the distance between player and the ball and if close enough, call the necessary function but it the action crashes at start

Code:
action theBall()
{
   set(my, SHADOW);
	
	phent_settype(my, PH_RIGID, PH_SPHERE);
	phent_setmass(my, 1, PH_SPHERE);
	phent_setfriction(my,90);
	phent_setelasticity(my,75,100);
	phent_setdamping(my,30,5);
	phent_addvelcentral(my,vector(10,10,0));
	ph_setgravity(vector(0,0,-500));
	
	my.emask |= ENABLE_FRICTION;
	
   	while(1){
   	if(vec_dist(my.x, player.x) < 20){
   		move_with_ball();
      }
   	 
		
		if(key_x){
			kick();
		}
		wait(1);
	}
 }




I know I can.