If GameObject is not active?

What I am trying to do seems like it would be pretty simple, but I just need to make sure of a few things. I have set variable1 for the GameObject that the script is attached to, and also variable2 for another item that should only be active if variable1 is active also. I need to understand how to allow it to say that when variable1 is not active, variable2 isn’t either. Here is a bit of what I was thinking:
var Variable1 : GameObject;
var Variable2 : GameObject;

function Start () {

}

function Update () {

}
function OnGUI () {

       if (Variable1.active = false))
            Variable2.active = false;
}

Obviously, this is just in idea because it doesn’t work. This was just an example to show you what I am sort of thinking.
Thanks for the help!

Pretty much that, but you should do it in Update not OnGUI. Use Variable1.active == false (note the == not = )