Using a variable for decreasing health?

Hello,

I’ve been programming for a few months in GML and a bit in Actionscript 2, but I haven’t figured out how to use the amount of damage as a variable in JavaScript.

It would be really appreciated if someone could help me with this.

var otherobject : String = "something"; 
var Damage : String = "10"; 

function OnCollisionEnter(theCollision : Collision)
{
	if (theCollision.gameObject.name == otherobject)
	{
		var Health = - Damage;
	}
}

Thanks,

~MoC

Try this code:

var otherobject : String = "something"; 
var Damage : int = 10; 

function OnCollisionEnter(theCollision : Collision)
{
    if (theCollision.gameObject.name == otherobject)
    {
       var Health -= Damage;
    }
}