How to stop turret firing?

Hello everyone. I made a simple turret model. Added guns to it and made it fire. I added a box collider to the turret so whenever the player is in it, the turret will fire. It happened as i thought. Turret firing when player is in the collider. But the problem is i am not being able to make it stop firing when the player is out of the collider. It just keeps firing. Here is the script.

 void OnTriggerStay(Collider other)
{
    // Track turret
    Track();

    // Fire turret
	if(other.gameObject == player);
    {
        isFiring = true;
    
    }

Now, how can i make its firing stop as soon as the player leaves the collider???

Use Collider.OnTriggerExit to change isFiring to false when player leaves your collider.

OnTriggerExit(Collider other){
if(other.gameObject == player)
{
isFiring = false;
}

Have you tried OnTriggerExit?
Also you don’t need a semicolon on line 7.

Or you can use an else-statement. which goes as followed.

  void OnTriggerStay(Collider other)
 {
 // Track turret
 Track();

 // Fire turret
 if(other.gameObject == player)
 {
     isFiring = true;   
 }
 //if other gameObject is not player, isFiring is false.
 else
 {
    isFiring = false;
 }