i would try to add an area to the player, and one to the enemy. this can help you to understand areas better: "https://docs.godotengine.org/de/stable/classes/class_area.html"
now you also can add an area to the sword of the player, and to the weapon of the enemy.
you can now test if the enemy/player is getting hit by the sword of the player/enemy.
If the players swords area hits the area of the enemy itself, the enemy should get damage.
if the enemys weapons area hits the players area, the player should get damage.
the code for the stuff i say here, you will probably find pretty easily on the web.
if not, feel free to ask me :D