ok do this:
event1:
condition: keyboard: z pressed
action1: player: play animation and use the attack animation
event2:
condition1: player collision with enemy
condition2: player playing "attack" animation
action: enemy destroy
you can upload your capx to help you if you want ^^