Looping a hook

Hello, what would be the best way of looping my hook:



hook.Add( "KeyPress", "RemoveEntity", function( ply, key )
          if(ply:GetActiveWeapon():GetClass() == "weapon_sh_tool")then
             if(key == KEY_1 or key == KEY_2 or key == KEY_3 or key == KEY_4)then
                 ply:GetEyeTrace().Entity:Remove()
             end
          end
       end)


Did you look it up on the wiki? KeyPress doesn’t use KEY_ enums, it uses IN_ ones.

SO THATS WHY ITS NOT BEEN WORKING !!! I LOVE YOU!

code_gs said that KEY_ and IN_ keys are in the same “array” set.

anyway, I now need to know how to loop this:



hook.Add( "KeyPress", "Key Pressed", function(ply,key)
           if(input.IsKeyDown(KEY_1) or input.IsKeyDown(KEY_2) or input.IsKeyDown(KEY_3) or input.IsKeyDown(KEY_4))then
               ply:GetEyeTrace().Entity:Remove()
           end
       end )