Collidion with type detection

Hello, I need just a couple lines (an example) that will do something if gameobject collides with other gameobject that has a tag “TAG1” and do something else if it has a tag “TAG2”. I have tried but it doesn’t do anything:

function OnCollisionEnter(coll : Collision)
{
if(coll.gameObject.tag == "TAG1")
{
	type = 1;
	audio.PlayOneShot(audio1);
}
}

This one doesn’t work for me as well:

function OnCollisionEnter(col : Collision)
{
	if(col.gameObject.name == "clear_gold")
	{
		type = 8;
		audio.PlayOneShot(audio1);
	}
}

First make sure that the collision actually happens and add a Debug.Log before the if. Also, use CompareTag:

The collidion doesn’t work so I have created that thread http://forum.unity3d.com/threads/247989-Collidion-doesn-t-work-on-a-cube-attached-to-first-person-controller