CS0120 Error? Trying to access an 'int' from another script.

I have one script labelled ‘DestroyObjectAndLoseHealth’, this script is attached to an object labelled ‘Character’.

using UnityEngine;
using System.Collections;

public class DestroyObjectAndLoseHealth : MonoBehaviour {

	public int myHealth = 10;

	public TextMesh healthText;

	void OnTriggerEnter2D(Collider2D collisionObject) {
		Destroy (collisionObject.gameObject);

		myHealth = myHealth - 1;

		healthText.text = "Health: " + myHealth;

	}

//void Update () {
		//if (myHealth <= 0)
			//Application.LoadLevel("Game Over");}
}

I then have a script labelled ‘ItemDestroyer’, this script is attached to the object labelled ‘floor’.

using UnityEngine;
using System.Collections;

public class ItemDestroyer : MonoBehaviour {
	
	int myScore = 0;

	public TextMesh scoreText;

	void OnTriggerEnter2D(Collider2D collisionObject) {
		Destroy (collisionObject.gameObject);
			
		if (DestroyObjectAndLoseHealth.myHealth > 0)

			myScore = myScore + 1;
						
			scoreText.text = "Score: " + myScore;
			
		}
	}

Basically I’m trying to make it so that once myHealth has reached 0, myScore will no longer go up.

I haven’t been able to test this myself on an actual project, but I can see just by looking that at it that line 13 of the “ItemDestroyer” script should be:

if (GetComponent<DestroyObjectAndLoseHealth>().myHealth > 0)

Note that this might work it might not, but using C# you should probably stick with the right syntax. If it works please tell me, I’d love to know that it helps!