Error NullReferenceException: Object reference not set to an instance of an object

look at my codes

var score = 0;
var Score ;

var lookAround01 : MouseLook;
var lookAround02 : MouseLook;
var charController : CharacterController;

function OnTriggerEnter( other : Collider ) {
	if (other.tag == "Coin") {
    Score = score += 1;
    Destroy(other.gameObject);
    }
  }
  
function Start () 
{
	lookAround01 = gameObject.GetComponent(MouseLook);
	lookAround02 = GameObject.Find("MainCamera").GetComponent(MouseLook);
	charController = gameObject.GetComponent(CharacterController);
	
}
  
function Update ()
{
	if (Score == 7)
	{
		lookAround01.enabled = false;
		lookAround02.enabled = false;
		
		charController.enabled = false;
	}
}  
  
function OnGUI()
    {
    GUILayout.Label("Score = "+Score+"/15");
    if (Score == 7)
    {
    GUI.Button(Rect(Screen.width*0.5-50, 200-20, 100, 40), "WIN");
    }
    }

but it’s say i have an error on “GUILayout.Label(“Score = “+Score+”/15”);”
the error was like

help me (_ _)

Hello,

If the error message, it states that one of the elements of “GUILayout.Label("Score = "+Score+"/15");” has a value of null.

Since “Score” is the only variable in that line, I took a look at where you defined the variable:

line 2:

var Score ;

You neither defined the type, nor the value. So by default it’s value is “null”, therefore the “NullReferenceException”.

Hope this helps,
Benproductions1