Enemy Attack Script

Hello currently I my enemy can follow the player with the help of nav mesh but I’m having trouble making an enemy attack script.

Can I get put in a proper direction so that the enemy can attack the player?


(deep description of the issue)
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam venenatis libero turpis, in fermentum arcu maximus at. Donec a faucibus lectus, sit amet mattis tellus. Duis venenatis tortor a mollis congue. Pellentesque molestie neque urna, nec rutrum urna placerat vel. Morbi mollis erat vitae lacinia ullamcorper.

Screenshots:
:framed_picture:
:framed_picture:

Here is my code:

// paste code here