Updating Variable

How am I able to update continously the variable

light.intensity

in the following script as for my light.Intesity always to have the value of

lightIntensity

Now light.intensity is updating only when I turn the flashlight off and then on ?

private var FlashLightOn : boolean = false;
var flashlightSound : AudioClip;
var drainSpeed : float = 0.1;
var powerUpSpeed : float = 0.2;
var lightIntensity : float = 2;
		
	// Use this for initialization
function Start () {
	
	}
	
	// Update is called once per frame
function Update () {
	if(Input.GetButtonDown("toggleLight") && FlashLightOn == false){
			FlashLightOn = true;
			audio.clip = flashlightSound;
			audio.Play();
			light.intensity = lightIntensity;					
		}
		else if(Input.GetButtonDown("toggleLight") && FlashLightOn == true){
			FlashLightOn = false;
			light.intensity = 0;
			audio.clip = flashlightSound;
			audio.Play();
			
		}

					
		
			if(FlashLightOn == true){
					lightIntensity -= drainSpeed*Time.smoothDeltaTime;
					
			}
			else if( FlashLightOn == false)
					lightIntensity += powerUpSpeed*Time.smoothDeltaTime;
if( lightIntensity >= 2)
	lightIntensity = 2;
	
if ( lightIntensity <= 0)
	lightIntensity = 0;																			
					 					 			
	}

Ok, either I’m stupidly misreading something, or you just need something like

if(FlashLightOn){
	light.intensity = lightIntensity;
}

near the end of your Update()