destroying an object instantiated that came out of spawn point

hi i have a problem here i want to destroy an object that comes out of an spawn point im trying to do 3 different spawn points and so they can throw different objects from them that will hit the player the spawn is fine and everything but as i said i cant make them dissapear if i use destroy(gameobject) it will destroy the spawner and well that is not good. in any case heres my code

var timeToWait : float = 1;
var timeToWait2 : float = 4;
private var timer : float = 0;
private var timer2 : float = 0;
var beginSpawn : boolean = false;
var prefab : Transform;
private var spawnPoint : Vector3;
function Update()
        spawnPoint = this.transform.position;
        timer += 1*Time.deltaTime;
        timer2 += 1*Time.deltaTime;
        if(timer >= timeToWait)     
          prefab =Instantiate (prefab, spawnPoint, this.transform.rotation);
            timer =0;

            prefab.transform.position.z -=0.1;
        if(timer2 >= timeToWait2)
        timer2 =0;

to make it easier what i want to do is destroy the things that come out of the spawner after a certain time and thats about all thank you (oh yeah this code is inside my spawners and i want to use Transform for this tyvm)

if you cant understand what im trying to do tell me and i will try to explain >.<

Okay im not sure exactly what your after but it sounds like you could benefit from a little bit more information. In this is example lets say we have a game with a cannon that fires a cannonball every 5 seconds, the player does not control this object or its actions.

In your scene First create a cylinder gameobject. This will be our cannon.Next create a new javascript. Name it something like "CannonScript". In the project window drag the CannonScript onto the Cannon in the hierarchy window. Next (with the CannonScript selected) go to "edit" in the inspector window this will open your script editor of choice. In the script paste this code. Make sure you read and understand it!

//this is where we will specify the cannonball prefab in the inspector
var CannonballPrefab : Rigidbody;
//this is when the next shot will be instantiated, it goes up everytime the function succesfully plays through
var nextShotTime : float = 4.0;
//this is the time inbetween each instantiate, you can edit this time in the inspector to make the time between shots longer
var timeBetweenShots : float = 4.0;
//this is how fast your cannonball will be fired, change this in the inspector depending on how big your level is
var CannonballSpeed : float = 2;
//change this depending on how big your cylinder is,this is for if it's scaled by 1
var offset : float = 1.6;
//the actions in this function are performed every frame
function Update()
    //exectued when the variable "nextShotTime" is less than the time passed in the game
    if (nextShotTime < Time.time)
        //this first line adds the "timeBetweenShots" variable to the "nextShotTime" variable
        nextShotTime = Time.time + timeBetweenShots;
        //this is where you instantiate the CannonballPrefab which you should have set, for the script, in the inspector
        //this line states that the CannonballPrefab will be instantiated on the "up/Y" axis of the Cannon, the offset is so that it comes out of the end.
        var Cannonball = Instantiate(CannonballPrefab, transform.position + transform.up*offset, transform.rotation);
        //this line gives the Cannonball, which we have instatiated, a direction and speed to go.
        Cannonball.rigidbody.velocity = transform.up * CannonballSpeed;
        //this is a debug log, you can see if the script has worked as a message will pop up in the bottom right corner of the Unity editor
        Debug.Log ("Cannon has just fired");

Next you need a cannonball so create a sphere in the scene,call it Cannonball, and with it highlighted in the hierarchy give it a rigidbody (Component ~> Physics ~> Rigidbody) Now create a new prefab in the project window and drag the Cannonball from the hierarchy window onto the prefab in the project window. With the Cannon selected, drag the newly made Cannonball prefab into the approriate slot under the Cannon's CannonScript component. Then create a new javascript to be attached to the Cannonball. This script is for destroying the Cannonball whenever it collides with something, for example your player or the ground.

function OnCollisionEnter(collision : Collision)


Press play and you should now see the Cannon firing the Cannonball(Clone) in whatever direction the Y axis is pointing. If not check the debug log is there. If the debug log is not there check for error messages. If the debug log is there then adjust the Cannon's variables in the inspector while the game is running (during runtime) until you can see it. Once you can see the Cannonballs then you can start playing around with the different elements like shot speed and the mass and gravity on the rigidbody. You can also create 3 prefabs of the Cannon, the same way you made a prefab of the cannonball, and put a different type of cannonball and different shot settings on each cannon prefab.

put the destory object script on the prefab of what ever it is your instantiating. So something like

function Awake
  yield WaitForSeconds (4);
  Destroy (GameObject);

WARNING this is just sample code you will have to assign your own variables and such.

Your spawned objects are prefabs. Just attach the script to the prefab, then every instance will have the script attached.

var destructTime: float;

function Awake()
Destroy (gameObject, destructTime)