Turn On and Off Lights Via Script

Hi, I’m working with a car and would like to implement lights into it, which works by using a script that activates a texture and a point light to create the effect of a working brake light, but with the code that I’m using the textures work but the lights don’t, how can I fix this problem?

Brake Lights Code :

var leftBrakeLight : GameObject;
var rightBrakeLight : GameObject;

var leftLightSource : Light;
var rightLightSource : Light;

function Start() {

 leftBrakeLight.renderer.enabled = false; 
 rightBrakeLight.renderer.enabled = false;
 leftLightSource.enabled = false;
 rightLightSource.enabled = false;

}

function Update () {

        if (Input.GetKeyDown(KeyCode.Space))

{       
		leftBrakeLight.renderer.enabled = true; 
		rightBrakeLight.renderer.enabled = true;
		leftLightSource.enabled = true;
 		rightLightSource.enabled = true;

    }

    else

        if (Input.GetKeyUp(KeyCode.Space))

{       
		leftBrakeLight.renderer.enabled = false; 
		rightBrakeLight.renderer.enabled = false;
		leftLightSource.enabled = false;
 		rightLightSource.enabled = false;

    }

}

Maybe this will work better:

if (Input.GetKeyDown(Keycode.Space))
{
light.intensity = 1.0;
}

if (Input.GetKeyUp(Keycode.Space))
{
light.intensity = 0;
}

obs: attach it to the lights, you can make one script for each light on the car, this will give you better control of the actions involving the lights