Error in script to make a monster shoot against the player

I have done a function to use in a script for one of my monsters (on my 3d plattaform game) and I have a problem with it, when I test the game, it crashes with unity and I have to terminate the process through Ctrl+alt+del. Do you have any idea what is going wrong?

Here you have the code (I have a rigidbody on unity too to use it as bullet, and its passed through the editor to the script):

var projectile : Rigidbody;

function Shoot ()
{
    while(true){
            // Instantiate the projectile at the position and rotation of this transform
        var clone : Rigidbody;
        clone = Instantiate(projectile, transform.position, transform.rotation);

        // Give the cloned object an initial velocity along the current
        // object's Z axis
        clone.velocity = transform.TransformDirection (Vector3.forward * 10);
        }
// yield for one frame
        yield;      
}

You put yield outside of your infinite loop. Put in before the curly brace instead of after. If you line up your curly braces better, you'll have a better chance of catching mistakes yourself.