Need Script For Enemy AI

So,I am not the best at coding and i have been trying to make/find an enemy AI that would work for my game,but I cant. I need a script that makes the enemy chase the player, in a 3d environment, if they enter a box collider component attached to the enemy,and if the player stays outside of the box collider for a certain amount of time,the enemy would stop chasing them. Any help at finding,creating a script?

Use the AI Controller script in the standard assets pack. Add it to the object in the inspector view. Then I guess the easiest way to do the collier would be to add one to the AI and then make a script that uses OnTriggerStay. Use that you can tell it to enable and disable the Ai script if the player is inside or outside the collider . Remember to make sure that the collider is a trigger.