Hit marker isn't in position of the cursor and not sure how to add fireRate to my javascript code.

This is the Raycast Shooting script

#pragma strict

var hitMarker : Texture2D;

var par : Transform;
var TheDamage = 25;
var fireRate = 0.5;

private var lineTransform : Vector3;
private var startTransform : Vector3;

var isHitEnemy :boolean = false;
function FixedUpdate()
{
    isHitEnemy = false;
}
function Update ()
{
    var hit : RaycastHit;
    var ray : Ray = Camera.main.ScreenPointToRay(Vector3(Screen.width*0.5, Screen.height*0.5));
    if(Input.GetMouseButtonDown(0))
    {
        if (Physics.Raycast (ray, hit , 100))
{
    var clone = Instantiate(par, hit.point, Quaternion.LookRotation(hit.normal));
    Destroy(clone.gameObject, 1);
    hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReceiver);

}
    if(hit.rigidbody)
    {
        if(hit.transform.tag == "Enemy")
        {
            isHitEnemy = true;
        }
    }
}
}

function OnGUI()
{
    if(isHitEnemy ==true)
    {
        GUI.Label(Rect(Screen.width/2, Screen.height/2, 200, 200), hitMarker);
    }
}

This is the cursor script

         var mouse : Vector2;
         var w : int = 32;
         var h : int = 32;
         var cursor : Texture2D;
        
         function Start()
         {
             Cursor.visible = false;
         }
        
         function Update()
         {
             mouse = new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y);
         }
        
         function OnGUI()
         {
             GUI.DrawTexture(new Rect(mouse.x - (w / 2), mouse.y - (h / 2), w, h), cursor);
         }

You didn’t use cursor position for ray, but center of screen.
For fireRate you can use for example timer

var timeBetweenFires : float = 0.3f;
var timer : float = 0;

function Update()
{
   timer  -= Time.deltaTime;
   if (timer < 0)
   {
      Fire();
      timer = timeBetweenFires;
   }
}

function Fire()
{
    var hit : RaycastHit;
    var mouse : Vector2= new Vector2(Input.mousePosition.x, Input.mousePosition.y);
    var ray : Ray = Camera.main.ScreenPointToRay(mouse );
    if(Input.GetMouseButtonDown(0))
    {
        if (Physics.Raycast (ray, hit , 100))
        {
           var clone = Instantiate(par, hit.point, Quaternion.LookRotation(hit.normal));
           Destroy(clone.gameObject, 1);
           hit.transform.SendMessage("ApplyDamage", TheDamage,SendMessageOptions.DontRequireReceiver);
        }
        if(hit.rigidbody)
        {
            if(hit.transform.tag == "Enemy")
            {
                isHitEnemy = true;
            }
        }
    }
}

So, i have 2 questions. One being the object shows up once it hits the destination and 2 how do i turn my gun from being a one click one bullet to hold to shoot and shoots many bullets if that makes sense?

Edit: The hit marker is still beneath the cursor still :confused: