I can't get the delay between reloading and firing to work

I would like my player to not be able to shoot while reloading, I have reloading set to 2 seconds, but cannot get it to wait for 2 seconds before shooting is enabled. My code is below.

public bool IsReloading;
public float relTime = 2.0f;
float reloadTimer;

public update ()
{
if (reloadTimer < relTime)
{
reloadTimer += Time.deltaTime; // add into time counter
}

if (bulletsLeft <= 14)
{
PlayReloadSound();
//Invoke(“Reload”, 2f);
Reload();

    }

{

if (Input.GetKeyDown(“r”))
{
IsReloading = true;
reloadTimer = 0;

        if (totalBullets >= 15)
        {
            
            reloadAmount = (bulletsPerMag - bulletsLeft);
            totalBullets -= reloadAmount;
            bulletsLeft += reloadAmount;

        }
        else if (totalBullets > 0 && totalBullets <= 14)

        {
            
            reloadAmount = (bulletsPerMag - bulletsLeft);

            if (reloadAmount >= totalBullets)
            {
                reloadAmount = totalBullets;
                bulletsLeft += reloadAmount;
                totalBullets = 0;
            }
            else if (reloadAmount < totalBullets)
            {
                totalBullets -= reloadAmount;
                bulletsLeft += reloadAmount;

                
            }

            

        }

        if (reloadTimer > relTime)
        {
            IsReloading = false;
            reloadTimer = 0;
        }

        
    }

I need to see your shooting script to know were and how to disable it while reloading is true.
but the basic idea is to use the bool variable you have named as “IsReloading”
as a condition for making the fire add this somewhere in your shooting script
you will need to reference the script that has the bool variable so you can acces it

if (!IsReloading)  
{
  //Shoot
}