Script crashes unity

When ever i have this script active and try to run the game, it crashes Unity. I've got no idea why so can someone please explain:

var walkSpeed : float = 1.0;
var runSpeed : float = 2.0;
var gridSize : int = 10;

function Start () {
    var myTransform = transform;
    var startPosition : Vector3;
    var endPosition : Vector3;
    var t : float;
    var tx : float;
    var moveSpeed = walkSpeed;
    while(true) {
        if(Input.GetButtonDown("Fire1")){
            var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
            var hit : RaycastHit;

            if (Physics.Raycast(ray,hit)) {
            startPosition = myTransform.position;
            endx = hit.transform.position.x/2;
            endz = hit.transform.position.z/2;
            endPosition = Vector3(endx,0,endz);

                while (t < 1.0) {
                    moveSpeed = Input.GetButton("Run")? runSpeed : walkSpeed;
                    t += Time.deltaTime * (moveSpeed/gridSize);
                    myTransform.position = Vector3.Lerp(startPosition, endPosition, t);
                    yield;
                }
            }
            tx = t - 1.0;   // Used to prevent slight visual hiccups on "grid lines" due to Time.deltaTime variance 
        }
    }
}

You have an infinite loop. It's checking for the fire button being down an infinite number of times in one frame. I assume you want a yield in there.

Eric5h5 has it, but I don't think you can yield inside Start(). Try either firing another function and do the yield in there, or even more simply move the content of your while(true) to the Update() function which will be called on each frame.

change start to Update()