Gui Text appears after Clicking on an Object?

So ive got a key model, and ive used the code:

var KeyObject : GameObject;
function OnMouseDown()
{
  Destroy(KeyObject);
}

to remove the key after its been Clicked.
Now I want a text to appear on the screen saying “Key Obtained” after you have clicked it, and then make it go away after a couple of seconds. I am a begginer at java scripting so I would like some easy support.
Thankyou very much :slight_smile:

var KeyObject : GameObject;
var keyObtained : boolean = false;

function OnMouseDown()
{
  Destroy(KeyObject);
keyObtained = true;
}

function OnGUI(){
if(keyObtained == true){
GUI.Label(Rect(10,10,150,20),"You have the key");
// add timer to remove that text in n seconds
//...

}
}