Variable Adding Error

I’m a total noob at C#. I’m trying to add 1 to a deathcount when someone dies. The dying part works fine, it’s not mine my friend wrote it, but I’m trying to mess with it to get this working. Here’s the code:
using UnityEngine;
using System.Collections;

public class Health : MonoBehaviour {
public class deathCounter: MonoBehaviour {

	public float hitPoints = 100f;
	float currentHitPoints;

	// Use this for initialization
	void Start () {
		currentHitPoints = hitPoints;
	}
	void DeathWatch () {
	deathCounter = deathCounter + 1;
	}
		
	[RPC]
	public void TakeDamage(float amt) {
		currentHitPoints -= amt;

		if(currentHitPoints <= 0) {
			Die();
		}
	}

	void Die() {
		if( GetComponent<PhotonView>().instantiationId==0 ) {
			DeathWatch();
			Destroy(gameObject);
			DeathWatch();
		}
		else {
			if( PhotonNetwork.isMasterClient ) {
				PhotonNetwork.Destroy(gameObject);
			}
		}
	}
}
}

I get this error when I compile the script after closing it:

Assets/Health.cs(15,24) error CS0119: Expression denotes a ‘type’, where a ‘variable’, ‘value’ or ‘method group’ was expected

Can anyone help? Thx

Your ‘deathCounter’ should be a variable, not a class. Specifically, it should be an int (short for integer, meaning a whole number). So replace your line:

public class deathCounter: MonoBehaviour {

with something like:

int deathCounter;

You’ll notice that this is like your friend’s line ‘float currentHitPoints;’ ‘float’ is another kind of variable, like ‘int’, except it can store fractions as well as whole numbers. Both of these lines are making new varibles - telling the computer about some number you want it to remember. You will also need to get rid of one of the '}'s at the end, which got inserted automatically because you put in a ‘{’ higher up.

The computer will then keep count of how many have died, although you won’t be able to see the number it’s keeping count of, it will just be in the computer’s memory. To get it to actually display the deathCount will be quite a bit more complicated, although if you just write in after adding 1 to deathCount:

print(deathCount.toString());

That will print the count in Unity’s console view (one of the tabs in the editor) for now.