How To Enable/Disable +attack Without Opening Console

  • Looking for our server(s)? Go to our servers page after you've subscribed to our content pack. Hope you enjoy them!
  • You can purchase Premium Membership to enhance your game experience and support our community!
  • Meet other members and stay updated in our Discord and Steam Group. Find out how to get permissions on Discord here.
  • Are you interested in helping and being engaged in the community further? Apply for a Staff Position!


Dec 27, 2017
Massachusetts, United States of America
Are you tired of having to open the console to turn on +attack? Do you wish there was a way you could bind +attack to a key and not have to hold it down? Well look no further than this guide, because here I will show you a few quick console commands that will end this struggle.

Step 1) Open the developer console by pressing the (~) key. This key is called the tilde and is located to the left of the 1 key.

**If the console does not open, press escape and go to options. On the keyboard tab, click the ADVANCED button, and make sure "ENABLE DEVELOPER CONSOLE" is checked.

Step 2) Copy and paste the following, one line at a time:

alias attack_on "+attack; alias toggleattack attack_off"
alias attack_off "-attack; alias toggleattack attack_on"

**Additionally, you can copy and paste these 3 lines into your autoexec.cfg file, which is located in Steam\steamapps\common\GarrysMod\garrysmod\cfg

Step 3) The last thing you'll need to do is assign a key that will toggle +attack. Personally I chose my Z key but any available keys will work.

bind key toggleattack

Bingo! You're done! Now all you need to do is exit the console, and whenever you're out mining, press the key you assigned to enable +attack!


MRP Server Director
MRP Server Director
Forum Moderator
MRP Recruitment Team
Aug 3, 2018
Thank you, it works.. :)
  • Like
Reactions: FosterGecko