The player animation restarts without finishing once the condition is met

So im making a game where the player has a bunch of different animations. one of those animations is the attack animation. when the “p” key is pressed, the player animation changes to attack animation. The problem is that the attack animation is about 0.8 seconds long with about 10 frames, if the player clicks the attack key, the animation just restarts and doesnt get to the final frame (This is true for all other attacks animations as well). How can i fix this problem so even is the button is pressed 2 or 3 times, the animation has to finish playing before restarting

Maybe you could create a (scene or object player) boolean variable, let’s call it “attackmove”.
Set it to false.

Include it in your basic attack probably like this:

Condition:
If “attackmove” is false
p key is pressed
trigger once
Action
set “attackmove” to true
set animation of Player to “Slash”

Then create another event:

Condition:
If the animation of player is “Slash”
animation of player is finished (this line might need to be a subcondition, or not I’m not sure)
Action:
set “attackmove” to false