This is my function for the player animation but I have a problem that animation speed up and slow down by themselves. I do not know where I made a mistake, please if anyone can help me.
I hope that some of the more experienced guys can help me blush

Code:
function player_animations(){
	if(my.state_player == stand)
	{
 		while (key_cuu == 0 && key_cud == 0 && key_cul == 0 && key_cur == 0) // play the "stand" animation if force keys not pressed
		{
			ent_animate (me, "stand", my.skill96, anm_cycle);
			my.skill96 += 1 * time_step;
			my.skill96 %= 100;
			wait (1); 
		}
		my.skill92 = 0;
		while(my.skill92 < 100){
			ent_animate (me, "stand", my.skill92, anm_cycle);
			ent_blend("walk", 0, my.skill42); // blend "wait" into "walk"
			my.skill92 += 10 * time_step;
			wait(1);
		}
		while (1){
			ent_animate (me, "walk", my.skill97, anm_cycle);
			my.skill97 += 1 * time_step;
			my.skill97 %= 100;
			wait (1); 
		} 	
 	}
	if(my.state_player == walk)
	{
 		while (key_cuu == 1 || key_cud == 1 || key_cul == 1 || key_cur == 1) // play the "walk" animation until the player relase force keys
		{
			ent_animate (me, "walk", my.skill96, anm_cycle);
			my.skill96 += 1 * time_step;
			my.skill96 %= 100;
			wait (1); 
		}
		my.skill42 = 0;
		while(my.skill92 < 100){
			ent_animate (me, "walk", my.skill92, anm_cycle);
			ent_blend("stand", 0, my.skill92); // blend "stand" into "walk"
			my.skill92 += 10 * time_step;
			wait(1);
		}
		while (1){
			ent_animate (me, "stand", my.skill97, anm_cycle);
			my.skill97 += 1 * time_step;
			my.skill97 %= 100;
			wait (1); 
		}
 	}
 }