Ok im rewriting my question as the people below didnt quite get what i was asking
what line of code do i need to add into function apply damage to make it play a piece of audio whenever the ray cast hits it and how do i go about setting up an array with 3 pieces of audio the code i was given returns errors
#pragma strict
rigidbody.isKinematic = true;
var chop = 1000;
var FallingSound : AudioClip;
//var isKinematic: bool;
//var treemess : ParticleSystem;
private var ChopStreak1 = 0;
private var ChopStreak2 = 0;
function ApplyDamage (Damage : int)
{
chop -= Damage;
if (chop == 0)
{
Dead();
}
}
function Dead()
{
AudioSource.PlayClipAtPoint(FallingSound,transform.position);
yield new WaitForSeconds(2);
rigidbody.isKinematic = false;
Destroy (gameObject, 20);
}