FosterGecko

Suspended
Suspended
Member
Joined:
Dec 27, 2017
Messages:
95
Points:
27

6

Years of Mono

LV
0
 
Hello all, I figured to make up for making a fool of myself yesterday I would share a little bit of knowlege I obtained through, well as Boogie 2988 would say "through the POWER, of the internet."

As must of us know, there is a way to bind different actions to different keys in Garry's mod, however +attack is a little bit trickier considering it is a considered a canceled action as soon as you release said key that it is bound to.

Before you reply to this thread with "but Foster, it already easy enough to enter console and just type +attack or -attack!!1!" I am fully aware of this, this guide is just taking things up a notch with it and making the process just that much easier. Okay, let's get into these console comands, shell we?

I was looking to do this for crouch as well, where instead of holding the key, you could tap it once and have your character continue to be crouched. Here's what I found;

  1. alias duck_on "+duck; alias toggleduck duck_off"
  2. alias duck_off "-duck; alias toggleduck duck_on"
  3. duck_off
  4. bind ctrl toggleduck

Let me explain what these commands actually mean to the best of my knowlege. Any edits, write em below;

  1. alias duck_on "+duck; alias toggleduck duck_off" -This guy here turns an already established command or action into an "alias" which is just another name.
  2. alias duck_off "-duck; alias toggleduck duck_on" -Basically the same command needs to be placed again so as to counter the first one
  3. duck_off -This command disables duck to reset the player state in case the game thinks you are ducking
  4. bind ctrl toggleduck -This command binds everything we just did to a key, which in this case is the default crouch key
Now we can replace "+duck," toggleduck" and "duck_off/on" with "+attack, "toggleattack," and "attack_off/on."

  1. alias attack_on "+attack; alias toggleattack attack_off"
  2. alias attack_off "-attack; alias toggleattack attack_on"
  3. attack_off
  4. bind insertanykeyhere toggleattack

To finish off this guide, a couple of pointers;

  1. If you switch to another weapon or tool with +attack enabled, it will put you into a state of having +attack enabled, but you wont make any action since the game thinks you only want +attack to be active with the original tool, so you must press this key again to disable +attack then press it again to reenable it.
  2. You must not go afk while using this as stated in the rules.
  3. If you bind this to a key that you already use for another in-game action it will override said key and instead bind it to this action, making you to have to re bind the key to the previous action if you choose to restore it.
  4. Last and final tip, you must enter these commands every time you close and reopen the game, they will only stay until Garry's Mod is closed. If you wish to change this, there is a way to alter the config files but;
    1. I am not sure how
    2. Not sure if it is within the rules, consult an admin if you wish to do this. I am not liable for any consequences should action be taken against you for editing these files
 

Lil Pat

Suspended
Suspended
Member
Joined:
Jul 22, 2017
Messages:
231
Points:
52

7

Years of Mono

LV
0
 
Should be fine putting it in your autoexec. To get to your autoexec follow this path
C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\cfg
If you dont already have a text file named "autoexec.cfg" follow these steps to create one.
New text document
File > Save As
Name: "autoexec.cfg"
Select "all file types" from the drop down menu.

To add the command I recommend editing it with Notepad++. If you dont have it the regular notepad should work fine.
Add the commands as listed above in sequential order going down a line each command.
Ex:
alias attack_on "+attack; alias toggleattack attack_off"
alias attack_off "-attack; alias toggleattack attack_on"
attack_off
bind NUM4 toggleattack
 
Top