How Do I Make A Playable Sprite That Can Attack The Enemy WIth A Move Like A Sword?

I am working on making a Side-Scrolling Platformer game and I am having trouble with making my sprite char. What I want it to do is when you click a certain key, for example, the SPACE BAR, the sprite will lean forward and hit in front of it with a small sword in its hand. But I can’t seem to get it to actually injure the enemy but instead destroying it’s self.
Any Suggestions?

Do you have a link to the game?

You can use a second sprite (a slash effect perhaps) that is emitted in front of your player. Then, use a collision block between the enemy and the slash effect to produce damage.

There are a couple of sword examples on the examples page - maybe take a look at them for some ideas?

Thank you so much @grazer ! That was incredibly helpful. I’m working on the effect design now but I got it to work from your help.