Substracting health

So I have my towers’ armour, all nice and strong, but cannonballs and battering rams pass straight through it. I have a C Sharp script(from the wiki) that explodes on impact, but this is only good for projectiles, armour has to be able to take more than one hit. So could someone please give me a script that on collision with a certain object, will deduct say 5(but it could be 10 for a more powerful object) from var health=700 , and if health==<1, then it will destroy the object. I have a rough idea how to do it, but don’t really know how to put it onto the computer. Help will be greatly appreciated.

an easy way to do it is to set a script on the object just containing the damage you want those particular projectiles to have then with the trigger pull out that damage then your code will look something like

on collision
health -= getcollision objects damage
if (health <= 0)
{
destroy the armor
}

Yeah, thanks for that, but which part would I change to suit different projectiles?

The following event functions might help.

void OnTriggerEnter(Collider other) {

}
// for non-kinematic rigidbody
void OnCollisionEnter(Collision collision) {

}

Also read this post a week ago.
http://forum.unity3d.com/threads/88957-Enemy-Damaging-Player?highlight=SendMessageUpwards