Ingame Command

Okay so I’m unsure how to make / create this basically I want it so players can press a key say F1 and it will run a console command to act salute and say /me salutes

GM:PlayerButtonDown

Something like this might work.



if CLIENT then

hook.Add("PlayerButtonDown", "test", function( ply, key )
if key == KEY_F1 then

ply:ConCommand( "say /me Salutes" )

end
end)

end