How to change IN Enums in KEY Enums ?

Hey, I’m a beginner at lua and I have this problem, I made something to allows you to see your money when you press a key :


hook.Add( "KeyPressFaim", "keypress_faim", function( ply, key )
	if ( key == IN_WALK ) then
		ply:ConCommand("say /faim")
	end
end )

But I had to choose IN_WALK because I don’t know how to have KEY_F2, I’ve already tried a few things but I can’t find out how to do this.

And then I did this :


hook.Add( "KeyPressFaim", "keypress_faim", function( ply )
	if GM:ShowTeam(ply) then
		ply:ConCommand("say /faim")
	end
end )

It didn’t work

Thanks for your help, and sorry for my bad english.

ShowTeam is a hook. Use that for the event param instead of KeyPress.