I believe this was done before, but I thought I'd make my own. Uses "distance to" block to set the brightness (I thought it would be more realistic). Very simple, no variables used. Move around the mouse and hold the click to use the flashlight.