Key press hides object and spawns another

I have a playable character, I have it set to that on a key press he damages an enemy, but what I want is a script that will hide my character for 3 seconds and spawn an object in it's place and then after the 3 seconds destroy the spawned object and unhide the character. Any ideas?

    function Update () {
gameObject"spinny".active = false;
if (Input.GetKey ("fire1") && Time.1 >)
        gameObject"spinny".active = true;
        }

I guess you could do something similar to this (but make sure to read Joshuas links, not all will be free):

// Set this to the prefab you want to create.
var inPlacePrefab : GameObject;

function Start()
{
    // Thanks to Derek that pointed out we can't use Update.
    // The code has been revised, now we use another Update routine.
    StartCoroutine(UpdateInput());
}

function UpdateInput()
{
    while (true)
    {
        if (Input.GetButton("Fire1"))
        {
            yield HideAndSpawn();
        }
        else
        {
            yield;
        }
    }
}

function HideAndSpawn()
{
    // 1. Hide self with disabling renderer.
    renderer.enabled = false;

    // 2. Spawn that prefab in our place.
    var spawned = Instantiate(inPlacePrefab, transform.position, 
                                             transform.rotation);

    // 3. Wait 3 seconds.
    yield WaitForSeconds(3);

    // 4. Destroy the spawned item.
    Destroy(spawned);

    // 5. Show self with enabling renderer.
    renderer.enabled = true;
}

Just break it down into simple things. I'm pretty sure every step of the way has already been answered somewhere on this site.

How to execute a command on pressing a key.,

How to make something invisible.,

How to instantiate an object.,

How to set a timer.,

How to make something happen when timer reaches a certain point.

How to destroy an object.,

How to make something invisible visible again..

If there's a specific step you're having trouble with I'd be more then happy to help, that's what this site is here for. But we're not here to write free scripts for you.


Edit: when I wrote this the original question was a LOT less detailed, so ignore the tone of the message :) not deleting the actually post because the links might still be useful.