Action problem

i have made this code:

var attack = 90;  

so if i press the z-key it does the attack move, but if i press it again it does nothing. If i move and then pres the z-key it works again. Why do i need to move before i can do it again and how can i fix it?

tx, Niels