How to create script where if people have 15 coins = open the door in UNITY 3D

i already have it

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

public class coins : MonoBehaviour
{
    public int coinsCollected;
    public Text counterText;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Coins"))
        {
            coinsCollected++;
            other.gameObject.SetActive(false);
            counterText.text = coinsCollected.ToString();
        }
        
    }
}

@sanyochekk In your update function, you could put a little if statement:

if (coinsCollected >= 15) {

//OPEN THE DOOR

}