Can Someone help me with this script?

im trying to get this script to deactivate this gameobject when collided with the cube but if one gameobject is already deactivated to deactivate a differnt gameobject

the script

function OnTriggerEnter(other: Collider){
if (other.tag == “Player”){
GameObject.Find(“(1)Green”).SetActiveRecursively(false);

if (GameObject.Find("(1)Green") == false){
	GameObject.Find("(2)Yellow").SetActiveRecursively(false);

}
}
}

try using this :

function OnTriggerEnter(other: Collider){ 
	if (other.tag == "Player"){ 
		if (GameObject.Find("(1)Green").active == false){
	    	GameObject.Find("(2)Yellow").SetActive(false);
		}else{
            GameObject.Find("(1)Green").SetActive(false);
        } 
	} 
}