Newbie question

hello everybody ,

i have a question , im currently in the stage of knowing how to make a character move in third person fashion …

but now … i want to reach a step further …

i was able to make my character collect items with this script …


static var Count : int = 0;
var CollectSound : AudioClip;

function OnControllerColliderHit(hit:ControllerColliderHit){

if(hit.gameObject.tag == “gem”){

Destroy(hit.gameObject);
Count++;
audio.PlayOneShot(CollectSound);
}

}

and i have another script for the GUI

function Update () {

var prefix = "Gems: ";
var suffix = “/3”;
guiText.text = prefix + GemCollect.Count + suffix;

}

my question is … how the hell can i make an event trigger after collecting all the items …

thanks !!

var numberOfGems : int = 3;
function Update () {

var prefix = "Gems: ";
var suffix = "/3";
guiText.text = prefix + GemCollect.Count + suffix;

if(GemCollect.Count == numberOfGems)
{
 //do your stuff here
}

}

Thanks !! im a 3d artist so scripting aint my thing … but i wish to learn it so bad