Quote:

Well ok but i start that script in another while loop

Code:
if(mouse_left && proc_status(attackit) == 0)
{
attackit();
}



the while loop isnt a good solution in this way!




Maybe you could call the function( attackit(); ) out of the while loop from the action you're using it in and set the if statement ( if(mouse_left && proc_status(attackit) == 0) ) inside the while loop of the initial function ( attackit ).

Here the example:
Code:
 
action mainplayer() // this is the action you're calling the function from
{
// your code
attackit(); // call the function out of the while loop
while (player != null)
{
// your code
wait(1);
}
}

function attackit
{
proc_kill(4); // makes sure that only one instance of this function running so proc_status isn't needed here ^^
ani_attack1_speed = 8;
ani_attack2_speed = 8;
while(player != null)
{
randomize();
my.attack_choose = int(random(2));
if(mouse_left && my.attack_choose == 0)
{
while (ani_attack1 < 100) // Solange ani....
{
ani_attack1 += (ani_attack_speed * time_step)%100; // Ani Speed
ent_animate(my, "attack", ani_attack1, 0); // Ani Bfehl
wait(1);
}
ani_attack1 = 0;
}
if(mouse_left && my.attack_choose == 1)
{
while (ani_attack2 < 100) // Solange ani....
{
ani_attack2 += (ani_attack2_speed * time_step)%100; // Ani Speed
ent_animate(my, "attack2", ani_attack2, 0); // Ani Bfehl
wait(1);
}
ani_attack2 = 0;
}
wait(1);
}
}



This is another approach but basically this should work and the animations should run properly

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB