Keybindings for a server.

Hi there.

So I’m looking for a way to bind keys serverside so users don’t have to bind a key for the jukebox themselves.

hook.Add( "Think", "BM_Clients_Key", function()
    if input.IsKeyDown( KEY_1 ) then
    elseif input.IsKeyDown( KEY_2 ) then
    elseif input.IsKeyDown( KEY_F ) then
end )

I found this on the forums but, when I used it spammed the command.

Is there any way to make it so the command runs once when the user presses the key?

Thanks in advance.


Thanks for the link. :smiley:

Still don’t quite understand how to implement it though :frowning:

hook.Add( “KeyPress”, “uniquehookidentifiernamehere”, function( ply, key )

end );

Ah. I get it now. Thanks for the extra help man. :slight_smile: