OnTriggerEnter static var

Hi guys, so I looked up how to access a static variable from another script and I thought this was how it was done, but comes up with error damage is not a member of UnityEngine.Component.

var health = 3.0;
function OnTriggerEnter(collider : Collider){
	if(collider.gameObject.tag == "Fruit"){
		var script = collider.gameObject.GetComponent("Fruit");
		health -= script.damage;

a script called Fruit is on the gameobject with the tag Fruit, and damage is a float.

Don’t use strings in GetComponent; that makes it return Component instead of the correct type. There aren’t any static variables involved here, though.