Targeting Script Only Works One Enemy At A Time

I’ve been beating my head against the wall trying to make this script, and when it’s finally done, there’s still a problem I just can’t get around. This script is on every enemy, drawing a crosshair on itself whenever the player is near. It works fine for one enemy, but I tried 2 or 3 and I have to destroy enemy 1, so I can destroy enemy 2, then go for enemy 3. All these enemies have the same script-I really just copied and paste the enemies thierselves. I looked all this up, and it’s something about instances O_o, but I didn’t get it. I can’t make 300 different tags or seperate scripts, so there’s got to be a way around this. If anyone could give me a straight solution, I’d be greatful!

Here’s my script:

var selfEnemy : Transform;//Be absolutely sure to attach a "Mesh Renderer" to selfEnemy!
var musket : Transform;
var crosshair : Transform;
var head : Transform;
var distance = 20.0;
private var targetOn = false;

function Update(){
	if(Vector3.Distance(player.position, transform.position) < distance && gameObject.renderer.isVisible){
		targetOn = true;
	}
	if(Vector3.Distance(player.position, transform.position) > distance || !gameObject.renderer.isVisible){
		targetOn = false;
	}
	
	if(targetOn == true){
		musket.transform.LookAt(selfEnemy);
		head.transform.LookAt(selfEnemy);
		crosshair.guiTexture.enabled = true;
		crosshair.transform.position = Camera.main.WorldToViewportPoint(selfEnemy.position);
	}
	if(targetOn == false){
		musket.transform.localRotation = Quaternion.identity;
		head.transform.localRotation = Quaternion.identity;
		crosshair.guiTexture.enabled = false;
	}

	
}

function OnDestroy(){
	musket.transform.localRotation = Quaternion.identity;
	head.transform.localRotation = Quaternion.identity;
	crosshair.guiTexture.enabled = false;
}

If you duplicate enemies, you should check attached scripts on every enemies. You sure that every enemy have to attached “Transform” and the other components themselves.