Unknown identafier when calling Variable from another game object

Building a rail shooter and learning JAVA script. want to call “currentScore” Varable from my _Master gameobject whenver you unload a object when its clicked on.
the unload script works but when itry to use _MASTER.Getcomponet or try to use
_MASTER.currentScore it has an error Unknown Identafier.

//code is on my Enemy object that is unloaded. wheni ts unloaded want it 
to Add 100 Points to score and display in my "Master" game obect.



#pragma strict


function Start () {



}

function Update () {

  if (Input.GetMouseButtonDown(0)){
    var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    var hit: RaycastHit;
    if (Physics.Raycast(ray, hit)){
    
    
_MASTER.GetComponent("currentScore") += 100;
       
       Destroy(hit.transform.gameObject); 
      
     
     
    }
  }
}





///////// the code for the master game object below.//////////

#pragma strict

static var currentScore : int = 0;



function OnGUI () {

GUI.Label (Rect (10, 10, 100, 20),   "Score: " + currentScore);

}

///// I am trying to Lern this is really bugging me will be a good help thanks in advance Gang!

There are a few things wrong with how you are doing your GetComponent(), but since you’ve made ‘currentScore’ static, you don’t need GetComponent() at all. Assuming ‘_Master’ is the exact name of your second script, you can do:

 _MASTER.currentScore += 100;

More info on GetComponent():

http://docs.unity3d.com/412/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html

http://unitygems.com/script-interaction-tutorial-getcomponent-unityscript/

current score isn’t a component, so you don’t access it with GetComponent.

It’s a public static member, so just _MASTER.currentScore should work.