check bool across a script

so I have this Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class e_key_1 : MonoBehaviour
{
public GameObject get;
private GameObject key1;
public bool door1;

void OnTriggerEnter()
{
get.SetActive(true);
}

 void OnTriggerExit()
{
get.SetActive(false);
}

void OnTriggerStay()
{
    if (Input.GetButtonDown("use"))
    {
        get.SetActive(false);
        door1 = true;
        
    }
    
}

}

And i want to check if the door1 boll is true in a another script…

Btw im german so sorry if some words are wrong

Well you have to get a reference to that script from the other script:


public class OtherScript : MonoBehaviour
{
    [SerializeField] private e_key_1 scriptWithBool;

    private void Update()
    {
        if(scriptWithBool.door1)
        {
            //it’s true!!!
        }
        else
        {
            //it’s false
        }
    }
}