Making a 3d text object represent the "health" of an object?

Hello there, relatively new to unity and c# but right now i’m having a bit of an issue

I have this 3d text object on a “door” object, and said door will slide upward to open when the button right next to it is shot enough times. I want the 3d text’s “Text Mesh” to be the remaining “health” value of the button. How is this done? I tried this–obviously i couldn’t get it to work, i just don’t know why.

here is the script on the button, containing the “health”
public class shootbutton : MonoBehaviour
{

    public static float health = 600;
    public float bulletdamage = 1;
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag == "bullet")
        {
            health = health - bulletdamage;
        }
    }
}

and here is the nonfunctioning script for my 3d text object

public class scorereport : MonoBehaviour {

	void Update () {
        GetComponent.TextMesh().text = FindObjectOfType<bulletbehavior>().health;
    }
}

So here’s a simple example script to tackle this

JavaScript Version:

//The TextMesh component of the text, assign this in the inspector.
var TheText : TextMesh;
//The hitpoints of the button or whatever
var Health : int;

//When it gets shot
function Bang()
{
        //Subtract health by 1
	Health -= 1;
        //Sets the text to Hitpoints: <A number>
	TheText.text = ("Hitpoints: " + Health);
}

C# Version:

//The TextMesh component of the text, assign this in the inspector.
public TextMesh TheText;
//The hitpoints of the button or whatever
public int Health;

 //When it gets shot
void Bang()
{
        //Subtract health by 1
        Health -= 1;
        //Sets the text to Hitpoints: <A number>
        TheText.text = ("Hitpoints: " + Health);
}