Variable Value not being passed from DontDestroyOnLoad

//The BonusUpdateScript

#pragma strict

var score : int;

var bonusCount : int;

var dontDestroyPoints : GameObject;	    


function Awake()

{

	DontDestroyOnLoad(this);    	

}





function BonusUpdate (bonusCount : int)

{

	score = bonusCount + score;

	print("score from bu update = " +score);		

}

//The BonusScoring script

#pragma strict
//creates a drop down menu in inspector
enum thePages {Page1, Page2, Page3 };
var nextPageName : thePages = thePages.Page1;
var animClipNone : AnimationClip;
var animClipOne : AnimationClip;
var animClipTwo : AnimationClip;
var animClipThree : AnimationClip;
var score : int;
var bonusUpdateScript : BonusUpdateScript;


function Start()
{	
	if(GameObject.FindGameObjectWithTag("_Score") == null)
	{
		print("get returns null");
	}		
	
	if(Application.loadedLevelName == "BonusScene")
	{
		print(Application.loadedLevelName);		
		bonusUpdateScript = GameObject.FindGameObjectWithTag("_Score") .gameObject.GetComponent(BonusUpdateScript);
		bonusUpdateScript.BonusUpdate(score);
		score = score;				
		print("score from BS Update2 = " +score);
		print(Application.loadedLevelName);	
		StartCoroutine("BonusScore", score);
	}
	else
	{
	print(Application.loadedLevelName);	
	}			
}


function BonusScore (score : int) {	
	switch(score){
	 
	case 1:		
		if(animClipOne != null){			
			animation.Play();
		}
		yield WaitForSeconds(2);
		break;
	case 2:
		if(animClipOne != null){			
			animation.Play();
		}
		yield WaitForSeconds(2);
		break;
	case 3:
		if(animClipOne != null){			
			animation.Play();
		}
		yield WaitForSeconds(2);
		break;
	default:
		if(animClipOne != null){			
			animation.Play();
		};
		yield WaitForSeconds(2);
	}	
}

function GoToNextLevel(){
	Application.LoadLevel (nextPageName.ToString());
}

I have been on this for hours. I need the value of ‘score’ to be passed to the call from BonusScoring script. The DontDestroyOnLoad object appears in the hierarchy when on the ‘BonusScene’ level, and the score is correct in the Inspector window. However, the ‘score’ value, which is zero, from the BonusScoring script, I guess, supersedes the DontDestroyOnLoad object variable with the same name. I need to access the score so the script knows which animation (currently only one until the others are created) to play in the switch statement of the BonusScoring script.

There are no errors when running the scripts.

Thank you for your time in pondering my dilemma. Your help is greatly appreciated.

To answer that question for yourself please look up some OO tutorials and learn about namespaces while you’re at it. In that context score is the variable of the BonusScoring script instance, NOT the variable of the BonusUpdateScript script instance.