Kill Counter Doesnt Work On Instantiated Objects!

Hello, thanks in advanced for any answers. So im making a game where I have creatures that spawn (using instantiate) and I have a kill counter, but the counter only counts to one, when I kill the first enemy, then it just stops counting. I think its because every copy starts counting again from zero. Here is the code that goes into my enemy (its also a health script):

using UnityEngine;
using UnityEngine.UI;

public class health : MonoBehaviour
{
public float hitpoints = 100f;
public Text countText;
int count;

public void Start()
{
    count = 0;
}
public void recievedamage(float amt)
{
    hitpoints -= amt;
    if (hitpoints <= 0)
    {
        PlusPoints();
        Die();

    }
}

void Die() {
    Destroy(gameObject);

}
void PlusPoints()
{
    count = count + 1;
    countText.text = "Kills: " + count.ToString();
    Debug.Log(count);
}

}

I would suggest using two scrips, one for receiving damage and one for keeping score. The receive damage script is for the enemy which will tell the scoring when it is hit. So you will have one scoring script and many damage scripts. Keep the scoring alive and destroy the enemies after they have passed their score.

PS: it is receivedamage not recievedamage :wink: