Unity turning light of via script problem

Simply turning off a light via a colision with a button and on collison with another turning back on… However it’s not working. The light turns of fine, but does nto want to turn back on… annoying.

The code uyou see below is an evolution of a previous answer

the light script:

private var on = false;

function Start(){
	var someScript1 : lightingswitchScript;
	someScript1 = gameObject.GetComponent("lightingswitchScript");

	var someScript2 : lightingswitchScript2;
	someScript2 = gameObject.GetComponent("lightingswitchScript2");
}

function Update () {
    if (lightingswitchScript.lighttouch == true){
    lightoff();
    }
    if (lightingswitchScript2.lighttouchh == true){
    lighton();
    }
}

function lightoff (){
    if (lightingswitchScript.lighttouch == true){
    if(on == false){
		light.intensity =0;
			on = false;
			}
			else {
				light.intensity =2;
				on = true;
			}
		}
	}

function lighton (){
	if (lightingswitchScript.lighttouch == false){
				on= true;
	if (on == true){
			light.intensity = 2;
			}
			else {
    				light.intensity =0;    
			on = false;    
			}    
		}  
	}

Any ideas are greatly appreciated.

NOTE: this is new code.

ot try this:

Light myLight = ylight.GetComponent("Light");

In fact, “Light” is a component that you have to extract from a certain object, and not an object itself.