Light Script that increses brightness when button pressed then shuts off

I would like a Java script for a light that increases the brightness/range per second of a light when the space button is pressed, then once the light reaches a certain brightness/range it is shut off, or destroyed or the brightness starts to decrease

You’ll have to use the range and intensity attributes of the light. You could do something like:

function Update()
{
 if(Input.GetButtonDown("Jump")){
 {
 if(increaseEnabled)
 {
 myLight.intensity+=1;
 var increaseEnabled=false
 EnableIncrease();
 }
 }
}

private function EnableIncrease()
{
 WaitForSeconds(1);
 increaseEnabled=true;
}

Of course this could use some finetuning and declaring the variables but this should explain the idea.