Use FlashlightIsOn() for hud?

How do I make my hook hud display only when my flashlight is on?
I know I need to use FlashlightIsOn()
but how do I use it and where, it is hard to find instructions on the wiki for that

Create a function for the flashlight and loop through the player(s) checking if it is. If true then draw your HUD. Else, return false.

thx it worked