How to create shot system for AI?

I want to create shot system for AI. When my AI sees the player he must shoot it with balls.

thats a pretty simple but in depth topic. you would be best off to find some tutorials. but the basics would be on seeing the player via aiperception your enemy would set his forward vector to face the player then you would fire a event to fire the weapon.