How do I disable OnMouseDown();

Hey,
im trying to disable OnMouseDown only if the script that contains this function is disabled. But if it is not I want it to function.
But with the code I’m using 159290-b276343e-33d6-4c90-b9e6-74c588e49edf.jpegbelow, mouse down isn’t working at all when I enable the script. HELP!!

Hi, try this:

    using UnityEngine;
    using System.Collections;
    using UnityEngine.SceneManagement;
    
    public class ExampleClass : MonoBehaviour
    {
        void OnMouseDown()
        {
            if(gameObject.GetComponent<Destroyer>().enabled == true)
            Destroy(gameObject);
        }
    }