Here's the code I am using. As you can see, it's already in a while loop...

Code:
 
function kick_ball(){ //lets me kick the ball
performing_kick = 1;
my.skill48 = 0; //reset the animation
while (my.skill48 <= 100){ //while the animation hasn't finished
ent_animate(player,"pass",my.skill48,anm_cycle); //play the animation
my.skill48 += 2; //update the animation
if (my.skill48 == 50){
movement_ball.x = 15; //sets the ball's movement
movement_ball.z = -13;
posses = 0; //no one has the ball
kicked = 1;
}
wait(1);
}
movement_ball.x = 15;
movement_ball.z = -13;
posses = 0; //no one has the ball
kicked = 1;
wait(10); //just so I won't get the ball back immediately again
performing_kick = 0; //I'm not kicking it any more
}




When your script isn't working right, usually it's because it's doing exactly what you told it to. -An Unknown Programmer