How to make left clicking shoot a gun, help!

I need help, I am new to unity and have been watching videos along with going to some classes to learn how to program. I need help from someone to write the chunk of script that you put into your character controller script that allows the set gun (called gunCake) and so it shoots the bullet (bullets name is Cake) from the spawn point (spawn points name is spawnCake) but if you only get a chance to type something quick all I need is to know how to set the left click button on your mouse to spawn (shoot) the cake.

Thanks
~ PK_Noob

//this code goes on your spawnpoint Object

var bulletObject:GameObject;  //on the heriachy pannel, insert your bullet prefab here

function Update(){

if (input.KeyCode(Mouse.0) ){

 var shooty= Instantiate (bulletObject, transform.position, Quaternion.identity);
/* you can add velocity to the "shooty" variable but I forgot how to do it.
It's something like shooty.addVelocity(Vector3.forward*1000); 
search it in the scripting manual it's the only chore I'll give you */

}

}

Try that. No guarantees as I just pulled this out of my