[help] How can i make toggle on key press

hi i have a hud script where i need to make soo i can use 1 key to toggle on/off how can i do that :smiley:

This

https://runtime.fivem.net/doc/reference.html#_0xF3A21BCD95725A4A

and this

https://wiki.fivem.net/wiki/Controls

should do the trick.