how can i do this

I created a sword that when you right click a function is activated and these particles appear (picture) How can I make mobs and players in the radius in front of me do damage (I don't want a solution, just an approach) I would be very happy about tips...

Continue to help post