I'm trying to get a attack animation which will be played if the key "q" is pressed. It should be spamable, but you can't hold "q", you have to press every time you want a attack. So basically just press one time on the key "q", and the model does one full attack animation. (not in lightning speed). When the whole animation is over, you can press another time on "q" to get a new attack.

I tried different codes but I couldn't get the right one. My basic code looks like this:

Code:
action guard_with_pointer()
{
	guard1 = my;
	while (1)
	{	
          ent_animate(my, NULL, 0, 0);
          if (key_q && guard_life > 0)
           {	
	     ent_animate(my, "attack", attack_percentage, ANM_CYCLE); 
	     attack_percentage += 3 * time_step;
	   }
           wait (1);
        }
}



Last edited by h34dl4g; 05/25/10 20:18.

1338, beyond leet.