Garry's Mod

Garry's Mod

57 ratings
Quick melee attack
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Roleplay, Realism
File Size
Posted
785.000 B
20 Jun, 2015 @ 8:40am
1 Change Note ( view )

Subscribe to download
Quick melee attack

Description
Ever found yourself out of ammo with an enemy standing right next to you and you try to switch to the crowbar only to be killed before you can find it? Or a wooden barricade that you need to get past quickly and you don't want to spend precious ammo on it? Now you can bash em easily with a quick melee!

This script makes you switch to the crowbar, attack once, then switch back to your previous weapon again all in less than a second.

To make this work, you will need to bind "crowbar_melee" to a key using the command console.

For example:

bind "mouse3" "crowbar_melee"

This will activate the attack whenever you press the middle mouse button.

I understand this has probably been done before but this has not been copied from anyone else's code




To Change the crowbar to something else:

1. download the legacy version of this addon at: https://www.dropbox.com/s/62eg7o9nh8ynk88/quick_crowbar.zip?dl=0

2. put the unzipped quick_crowbar folder in "C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\addons"

3. open up "\garrysmod\addons\quick_crowbar\lua\autorun\quick_crowbar1.lua"

4. Replace the three places in the code where it says "weapon_crowbar" with your new weapon's code name

5. If the new weapon has a delay when switched to before the player can attack with it you might need to make the timers longer to make it work. The number values are explained as comments in the code.
33 Comments
bitc0nfused 15 May, 2021 @ 11:20pm 
can you make a version of it to work with fists, or does this one already work and im just missing something?
[SFBOT] Sgt. K. Bassiclan 8 Nov, 2019 @ 8:11am 
Just tried out this addon and unfortunately I couldn’t get it to work for any of the Cw 2.0 weapons, even ones with very fast switch times.
"Technae" 10 Sep, 2019 @ 9:06am 
Lol, sorry, yes. I actually did that like 3 hours ago when I realized that's why you were sending people to the legacy version that is just a folder instead of a gma.

Also, I did it with the default gmod fists and it works perfectly, though it tends to always use the left fist which tbh isn't really a big deal.

Thanks for the response. :3
62  [author] 10 Sep, 2019 @ 9:03am 
You can also drag the file called "quick_melee_attack_465252635.gma" from your addons folder onto gmad.exe found in GarrysMod\bin folder and it will create the legacy version of any addon in your addons folder for you to edit.
"Technae" 10 Sep, 2019 @ 4:31am 
Heya, I need the legacy version but dropbox has a download limit? [imgur.com]

I want to use your legacy version of the mod to utilize the default fists in gmod instead as it seems like a more freehand action than taking out your crowbar.

Though gun melee actions would be kewl too if you know where to get those.
Mordecai 7 Nov, 2018 @ 11:36pm 
When i change the weapon deploy speed to 1.00 it cancels the crowbar attack
fozz 1 Jun, 2017 @ 9:17am 
OR JUST DO FAST WEAPON SWITCH ;)
milky-millwall fc 3 Nov, 2016 @ 12:44pm 
i jusc copid and pasted "mouse3" "crowbar_melee" then changed it to "mouse4" "crowbar_melee"
great thing
62  [author] 16 Sep, 2016 @ 11:55am 
What guns are you trying to make it work with? If there is a switching delay programmed into a swep it won't work
Lisan al-Ghaib 16 Sep, 2016 @ 11:30am 
Okay, But, Can you help Me? When i Try To Melee, It switches the crowbar and It Doesn't Attack?