Fire rate of different weapons after being dropped

I made two weapon types, one is a machine gun and the other one is a pistol and then made an drop and pick up system but when i drop the machine gun and select my pistol it starts shooting like the machine gun.

here is my weapon scrip:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Weapon : MonoBehaviour
{
    public float damage = 10f;
    public float range = 100f;
    public Text ammodisplay;

    public int maxAmmo = 10;
    public int Ammo = 35;
    public bool ammoEmpty;

    public GameObject gunModel;

    private PickUp pickUp;

    public Text ammoText;

    public float aimSpeed = 4;

    public AudioClip gunShotClip;
    public AudioClip reloadClip;
    public AudioSource audSource;
    public int currentAmmo;
    public float reloadTime = 5f;
    private bool isReloading = false;

    private InventoryInput inventoryInput;

    public bool isMachineGun;

    public float recoilStrength = 2f;

    public Camera fpsCam;

    public Vector3 normalPosition;
    public Vector3 aimingPosition;

    public bool ShootEnable = true;
    public bool isAiming = false;


    // Update is called once per frame
    void Start()
    {
        inventoryInput = FindObjectOfType<InventoryInput>();

        pickUp = FindObjectOfType<PickUp>();

        audSource = GetComponent<AudioSource>();

        currentAmmo = maxAmmo;

        ShootEnable = true;
    }

    void OnEnable()
    {
        isReloading = false;
    }

    void Update()
    {
        fpsCam = GameObject.Find("/FirstPersonPlayer/MainCamera").GetComponent<Camera>();

        if (currentAmmo <= 0)
        {
            ammoEmpty = true;
        }
        else
        {
            ammoEmpty = false;
        }

        if (Input.GetKeyDown(KeyCode.L))
        {
            Ammo += 10;
        }

        if (Input.GetKeyDown(KeyCode.R) && currentAmmo != maxAmmo && Ammo != 0)
        {           
                StartCoroutine(Reload());
                return;            
        }

        if(currentAmmo <= 0)
        {
            ShootEnable = false;
        }

        if(currentAmmo >= 0)
        {
            ShootEnable = true;
        }

        if (Input.GetButtonDown("Fire1") && ShootEnable == true && ammoEmpty == false && isReloading == false && inventoryInput.open == false && isMachineGun == false)
        {
            Shoot();
        }

        if (Input.GetKey("Fire1") && ShootEnable == true && ammoEmpty == false && isReloading == false && inventoryInput.open == false && isMachineGun == true)
        {
            Shoot();
        }

        //ammodisplay.text = ("Munition:") + currentAmmo.ToString();
        if (Input.GetKey(KeyCode.Mouse1))
        {
            isAiming = true;
        }

        else if (!Input.GetKey(KeyCode.Mouse1))
        {
            isAiming = false;
        }
    }

    private void FixedUpdate()
    {
        if (isAiming == true)
        {
            gunModel.transform.localPosition = Vector3.Lerp(gunModel.transform.localPosition, aimingPosition, Time.deltaTime * aimSpeed);
        }
        else if (isAiming == false)
        {
            gunModel.transform.localPosition = Vector3.Lerp(gunModel.transform.localPosition, normalPosition, Time.deltaTime * aimSpeed);
        }
    }

    public IEnumerator Reload()
    {

        audSource.PlayOneShot(reloadClip);
        isReloading = true;

        yield return new WaitForSeconds(reloadTime);

        int totalAmmo = currentAmmo + Ammo;
        if (totalAmmo <= maxAmmo)
        {
            currentAmmo = totalAmmo;
            Ammo = 0;
        }
        else
        {
            int shots = maxAmmo - currentAmmo;
            currentAmmo = 10;
            Ammo -= shots;
        }


        isReloading = false;

    }

    void Shoot()
    {
        audSource.PlayOneShot(gunShotClip);
        currentAmmo--;

        Vector3 gunModelLocalPosition = gunModel.transform.localPosition;
        gunModelLocalPosition.z = gunModelLocalPosition.z - recoilStrength;
        gunModel.transform.localPosition = gunModelLocalPosition;

        RaycastHit hit;
        if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range))
            {
            Debug.Log(hit.transform.name);

            Leben leben = hit.transform.GetComponent<Leben>();
            if (leben != null)
            {
                leben.TakeDamage(damage);
            }
        }
    }
}

here is my Pick up/drop script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PickUp : MonoBehaviour

{
    private Weapon weapon;

    public bool reloadSound;

    public float transformX = 0.15f;
    public float transformY = 0.15f;
    public float transformZ = 0.15f;

    public Weapon gunScript;
    public Rigidbody rb;
    public BoxCollider coll;
    public Transform player, gunContainer, fpsCam;

    public float pickUpRange;
    public float dropForwardForce, dropUpwardForce;

    private Inventory inventory;


    public bool equipped;
    public static bool slotFull;

    void Awake()
    {
        weapon = GameObject.FindObjectOfType<Weapon>();
    }

    private void Start()
    {

        if (!equipped)
        {
            gunScript.enabled = false;
            rb.isKinematic = false;
            coll.isTrigger = false;
        }

        if (equipped)
        {
            gunScript.enabled = true;
            coll.isTrigger = true;
            slotFull = true;
            rb.isKinematic = true;
            
        }
    }

    private void Update()
    {
        if (player == null)
        {
            player = transform.Find("/FirstPersonPlayer");
        }

        if (gunContainer == null)
        {
            gunContainer = transform.Find("/FirstPersonPlayer/MainCamera/GunContainer");
        }

        if (fpsCam == null)
        {
            fpsCam = transform.Find("/FirstPersonPlayer/MainCamera");
        }

        Vector3 distanceToPlayer = player.position - transform.position;
        if (!equipped && distanceToPlayer.magnitude <= pickUpRange && Input.GetKeyDown(KeyCode.E)) pickUp();
    
        
        if (equipped && Input.GetKeyDown(KeyCode.Q)) Drop();


    }

    public void pickUp()
    {
        reloadSound = true;

        equipped = true;
        slotFull = true;

        transform.SetParent(gunContainer);
        transform.localPosition = Vector3.zero;
        transform.localRotation = Quaternion.Euler(Vector3.zero);
        transform.localScale = new Vector3(transformX, transformY, transformZ);

        rb.isKinematic = true;
        coll.isTrigger = true;

        gunScript.enabled = true;

       // weapon.ammodisplay.gameObject.SetActive(true);
        

    }

    public void Drop()
    {
        reloadSound = false;

        equipped = false;
        slotFull = false;

        transform.SetParent(null);

        rb.isKinematic = false;
        coll.isTrigger = false;

        
        rb.AddForce(fpsCam.forward * dropForwardForce, ForceMode.Impulse);
        rb.AddForce(fpsCam.up * dropUpwardForce, ForceMode.Impulse);

        float random = Random.Range(-1f, 1f);
        rb.AddTorque(new Vector3(random, random, random)* 10);

        gunScript.enabled = false;
        //weapon.ammodisplay.gameObject.SetActive(false);
    }

}

You mixed up GetComponent and FindObjectOfType
The first will get the a script of the type in question on the same gameobject.
The altter will return just the first instance of the type in question on any object in the scene.
So just change that in your pickup script and you should be fine.

just as an addition: Remove these

if (player == null)
         {
             player = transform.Find("/FirstPersonPlayer");
         }
 
         if (gunContainer == null)
         {
             gunContainer = transform.Find("/FirstPersonPlayer/MainCamera/GunContainer");
         }
 
         if (fpsCam == null)
         {
             fpsCam = transform.Find("/FirstPersonPlayer/MainCamera");
         }

from the update and add it to the Start()function of your pickup script.
If you’d have lets say 50 guns on the ground they’d do a total of 150 null checks each frame all the time for no reason at all.