Create a trigger area for the player?

Hi all, i’m doing a 2d test and basically i created an area where a sprite square has to throw a bullet / s to the player but only if the player passes in the trigger area i created. So when he leaves the area, the “square enemy” no longer throws the projectile. I tried to create the enemy script but unfortunately I couldn’t. Could you give me some help to create it? Thanks.

Ok guys after a few tries I got it, for those who need the code here it is, I hope I have been useful to you