Code:

action basketball
{
phent_settype (my, ph_rigid, ph_sphere);
// you should place this code on the main function, but it works
ph_setgravity (vector (0, 0, -386)); // play with this value

phent_setgroup (my, 3);
phent_setmass (my, 0.624, ph_sphere); // play with this value
phent_setfriction (my, 100);
phent_setelasticity (my, 25, 0);
// disable it for now, you must read this function on the manual
//phent_setmaxspeed( my, 500, 500);

//wait (3); //what for?
while (player == null){wait (1);}
while (1)
{
if (vec_dist (player.x, my.x) < 1000)
{
phent_enable(my,0);
my.skill22=1;
//wait (1); //what for?
}
wait(1);
}
}




I ran a test and it works fine now. When the ball reaches 1000 quants to the player, it stops and stays disabled temporarly