getting a variable from another script problem

Alright, so I made a script and attached it to an object, and when ever I shoot the object, it gets the level of the player and multiplies it by 1 (which now that i think about it, thats pointless). any way once health hits zero, the object explodes. This all works. But its also supose to add experience referncing the players script. but it doesn’t. I’ve tried restarting unity and everything. So I’m wondering if theres something wrong with my script. here it is:

var health = 5.0;
var explosion:Transform;

function OnCollisionEnter(hit:Collision){
	var level = gameObject.Find("Player").GetComponent(Level);
	var playerLevel = level.level;
	if(hit.collider.tag == "Fire Ball"){
		health -=1.0 * playerLevel;

function checkhealth(){
	var level = gameObject.Find("Player").GetComponent(Level);
	var playerExp = level.experience;
		playerExp += 50.0;
		Instantiate(explosion, transform.position, transform.rotation);
		Destroy (gameObject);

Your experience variable is of type float (which is a value-type, not a reference type like a class). this line just copies the value into a temporary variable:

playerExp = level.experience;

If you change the temporary variable the variable in your level script won’t change. Use either directly level.experience += 50.0 or assign the temp variable back to level.experience.