Editing score betwen scripts?

Hi I have 2 script:

using UnityEngine;
using System.Collections;

public class _GameManager : MonoBehaviour {
	
	static int lifes= 3;
public GUISkin guiSkin;

	void Awake() {
        DontDestroyOnLoad(transform.gameObject);
		
    }
	
void  OnGUI (){
	GUI.skin = guiSkin;
	GUI.Label( new Rect((Screen.width / 2) - 60,10, 200, 30), "Lifes: " + lifes);

}

}

and:

using UnityEngine;
using System.Collections;

public class ZlaOdpowiedz : MonoBehaviour {


	
    void OnTriggerEnter(Collider other)
    {
        _GameManager.lifes -= 1;
		Destroy(other.gameObject);
        Application.LoadLevel(1);
    }
}

I think you see what Im trying to do…
I get error and I cant repair it, someone can help me?

+I wanna to make "if (lifes == 0){ Application.LoadLevel (1); }
or somethink like thet

Thanks anyway :wink:

Your variable is private.
You wrote:

static int lifes;

By default it’ll be private.
I think you need this:

public static int lifes;