GetComponent Picking up multiple scripts from differrent objects?

I have a player who shoots a raycast at a target, the raycast hits this target and returns its tag. The object hit has multiple copies of itself from the same prefab (its a target board to shoot at) and each copy has it’s own script which has a function which deducts health when it is shot.

The gun’s code:

if (Physics.Raycast(Spawn.position, direction, hit, range)) {
    		if (hit.collider.tag == "target") { 
    			var targ : GameObject = hit.transform.gameObject;

The target’s code:

static var health = 50;

function takeHealth(mod) {
	health = health - mod;

function isDead() {
	if (health <=0) {

My problem is, if I destroy one of these targets, all of the target’s healths will be deducted. How do I stop my game from deducting the health from all of them and only the one i am shooting at?

Just remove the static keyword: it’s declaring that health is the same variable for all scripts, but what you need is a local health in each target (non-static).