flashlight on and off

function Update() {

if (Input.GetKeyDown(“f”)) {

 if (light.enabled == true)

     light.enabled = false;

     else

     light.enabled = true;

 }

}

this is my code and it said my codes are obsolete

use:

if(Input.GetKeyDown(Keycode.F))