At this page:
you can see those KEYS like KEY_F which is “F”.
And there are those:**
you can see those ACTIONS like IN_ATTACK which is “the left mouse button”.
My question is how can I use the KEY Enumerations as a function like those IN Enumerations
As we can see those IN Enumerations can use as example
hook.Add( "KeyPress", "keypress_use_hi", function( ply, key ) if ( key == IN_USE ) then print( "hi" ) end end )
And I want to use a key from the KEY Enumerations to check if that key is pressed like “F” then it should run something. And maybe have a cind function like the flashlight like it checks if its on or off.