
simple if $flash wont work... your scripting skill is very bad and I think nobody will help you.
on:attack1 {
if($flash==0){
skipevent;
if(lives("unit",1)==1){
play "dog_bark1.wav";
flash 0,255,0,0.8,1.3;
}
}
}