I believe this will work. There are better ways to that but this one is good enough too. Hope this is helpfull.


Code:

action heart_beat()
{
var beat;
var anim_perc;

while(1)
{
if(mouse_left && beat == 0){while(mouse_left){wait(1);}beat = 1;}
if(mouse_left && beat == 1){while(mouse_left){wait(1);}beat = 0;}

if(beat == 1){
ent_animate("heart.mdl", anim_perc, ANM_CYCLE);
anim_perc += 10 * time_step;
}

wait(1);
}
}





Ubi bene, ibi Patria.