That did the trick logan, thanks laugh. I have one last thing, I noticed that when I jump, the second part (falling) doesn't start when my animation is above 50. I just keep hovering in the air. The "{jumpheight = 0;}" does run, but the other lines don't run.



function jump()
{
jumpheight = 10;
while (my.ANIMATION <= 50)
{
my.ANIMATION += 10*time_step;
ent_animate(me,"jump",my.ANIMATION,0);
jumpheight += 0.5*time_step;
c_move(me, nullvector, vector(0,0,jumpheight), GLIDE);
if (my.ANIMATION > 50)
{
break;
}
wait(1);
}

if (my.ANIMATION > 50)
{jumpheight = 0;}
while (my.ANIMATION > 50)
{
my.ANIMATION += 10*time_step;
ent_animate(me,"jump",my.ANIMATION,0);
jumpheight -= 0.5*time_step;
c_move(me, nullvector, vector(0,0,jumpheight), GLIDE);
if (jumpheight <= 0)
{
break;
jumpheight = 0;
my.ANIMATION = 0;
my.STATE = 1;
}
wait(1);
}

}