Use a global variable trigger.
When you are not attacking set it to a number and when you are attacking set it to a different number.
On Key Press Left: Set animation player to "walk"
Movement=1
On Key Press Attack: Set Movement=0
On Movement=0: Set animation "Attack
............................. Wait X seconds
............................. Set Movement=1
That way your player will not move when attacking.
Yeah the animation stops but when I press the right arrow while attacking the player still slides left and right just no walking animation.