not resetting the death count on reload

I have a death counter that each 3 deaths the death resets to 0 and a revmob ad is displayed. but when i reset the level the death count also resets, i tried making it static but it keeps counting after 3 and doesn’t resets.
I thought using PlayerPref but I’m not sure how efficient that is and I didn’t test it, can somebody shed a light upon my problem?

                private int death;
                death ++;
		Debug.Log (death);
		if (death == 3) {
			revmob.ShowFullscreen ();
			death = 0;

The solution is to make it static, if you say that it didn’t reset when you tried it, you should force the reset in any start() method (or in your resetLevel() method, if it exists).
I suggest you make a static class called GlobalVariables and inside this class put the public static int numOfDeaths. Then you could access it from any script this way:

GlobalVariables.numOfDeaths = 0;
GlobalVariables.numOfDeaths++;

or whatever

The problem is that the variable is private from the class. It is created again when the class is recreated, so it will always have the same value.
You need something like a gamestate singleton that survives your reloads of the levels. Here is a nice article showing you how to implement it:

http://www.fizixstudios.com/labs/do/view/id/unity-game-state-manager

You said “it keeps counting after 3”

 public int death;
         death += 1;
         Debug.Log (death);
         if (death > 2) {
             revmob.ShowFullscreen ();
             death = 0;

Try this, and if it doesn’t work, then I don’t know.

@SirBoboHobo
make death int static (You can exclude [SerializeField] and make int public)

[SerializeField]
private static int deathCount;

Are you sure you’re placing code below in void Update?

void Update () {
    if (deathCount == 3){
     deathCount = 0;
  }
}

u just need on your public int to mention its zero:

public int Deaths = 0;

void Update ()
{
if (Deaths>=4f)
{
Deaths = 0;
}
}