Turret stops firing when enemy is out of range

So currently I want my turret to fire if the “monster” tag is within 500 yds (as an example). It will correctly do this, but if it doesn’t kill the monster while it’s still in it’s turret range it will stop firing and not fire anymore… I spawn 30 ‘monsters’ all with the “monster” tag. Should I rename the tags for each monster?? What it’s currently doing is not switching targets when one is out of range. I’m not sure what I could do to fix this.

function Update () {
//if (Timer < Time.time) {
	if (GameObject.FindWithTag("monster")) {
		
		var distance = Vector3.Distance(this.gameObject.transform.position, GameObject.FindWithTag("monster").transform.position);
		if (distance < 500 && GameObject.FindWithTag("monster")) {
			
			missle = Instantiate(projectile, this.transform.position, this.transform.rotation) as GameObject;
			missle.transform.position.y = this.transform.position.y + 70;
			missle.transform.position.z = this.transform.position.z + 100;;
			missle.transform.localScale += Vector3(100,100,100);
			missle.tag = "missle";
			missle.AddComponent("Rigidbody");
			missle.AddComponent("FireMissles");
			missle.AddComponent("SphereCollider"); 
			
		}
	}
	//Timer = Time.time + 1;
	}
}

This is attatched to the ‘missle’ object

#pragma strict

public class FireMissles extends MonoBehaviour {

var targetTag : String;
var target : Transform;
var speed : float = 500;

function Start () {
var tar = GameObject.FindWithTag("monster");
if (tar) {
	target = tar.transform;
	}
}

function Update () {
	transform.LookAt(target);
	transform.Translate(Vector3.forward * speed * Time.deltaTime);
}



}

You can add a sphere collider to your turret and set it as a trigger. Then you can use this method:

var isAiming = false;
var target : Transform;

function OnTriggerEnter(var collEnter : Collider)
{  if(!isAiming)
   {  isAiming = true;
      target = collEnter.transform;
   }
}

function OnTriggerStay(var collStay : Collider)
{  if(isAiming && collStay.transform == target)
   {  
       //shoot; 
   }
}

function OnTriggerExit(var collExit : Collider)
{  if(isAiming && collExit.transform == target)
   {  isAiming = false;
      target = null;
   }
} 

This is if you want to aim at one monster at a given time.