Garry's Mod

Garry's Mod

88 ratings
TTT Pocket Headcrab
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Weapon
File Size
Posted
Updated
17.419 KB
24 May, 2017 @ 9:46pm
24 May, 2017 @ 11:59pm
3 Change Notes ( view )

Subscribe to download
TTT Pocket Headcrab

In 1 collection by alex / my 📱 is my 📡
Cutie Café
2 items
Description
The Pocket Headcrab is a grenade that, when detonated, spawns 1+ Headcrabs.

This SWEP was designed for Trouble in Terrorist Town ONLY - it will not work on other gamemodes. This SWEP is highly customizable through the use of ConVars.

It is highly recommended that you use the Workshop addon directly (rather than extracting it - in fact, please don't do that) as there may be small patches that I have to send out. I will not provide support for releases older than the latest. If you decide to extract the addon anyway, subscribe to this discussion to receive notifications of new releases.

ConVars
* denotes ConVars that may require a map change to take effect

qtc_headcrab_name* - Sets the name of the Pocket Headcrab. (default: Pocket Headcrab)
qtc_headcrab_icon* - Sets the icon of the Pocket Headcrab. Set this to 0 for blue, or 1 for red. (default: 1)
qtc_headcrab_slot* - Sets the slot of the Pocket Headcrab. Remember, slots are zero-indexed, so setting this to 3 really means slot 4. (default: 3)
qtc_headcrab_canbuy* - Sets who can buy the Pocket Headcrab; 0 for Detective, 1 for Traitor, or 2 for both. (default: 1)
qtc_headcrab_limitedstock* - Sets whether the Pocket Headcrab is in 'limited stock', i.e., it can only be purchased once per round. - (default: 1)
qtc_headcrab_count - The number of Headcrabs that spawn when the grenade detonates. New headcrabs will spawn every 0.5 seconds. This hasn't really been tested much, as this isn't in our use case. Please let us know what you think. (default: 1)
qtc_headcrab_die - Kill the the thrower of the grenade after it detonates. You should probably keep this at 0 unless you know what you're doing. (default: 0)
qtc_headcrab_dmg - Setting this to 1 will damage players around the grenade projectile when it detonates. (default: 0)
qtc_headcrab_dmgamt - If qtc_headcrab_dmg is set to 1, this will determine how much damage the grenade projectile does when it detonates. (default: 25)
qtc_headcrab_dmgradius - If qtc_headcrab_dmg is set to 1, this will determine the radius that grenade projectile will do damage in when it detonates. (default: 256)
qtc_headcrab_health - The HP of the spawned headcrabs. The default is that of the Headcrab entity's, 10, but we recommend turning this up to at least 40 (two crowbar shots). (default: 10)
qtc_headcrab_crab - The type of spawned headcrab. Set to 0 for normal, 1 for poison, 2 for fast, or 3 for random. (default: 3)

Credits
The icon was compiled by Onion Wizard.

Programming and assembly by Cutie Café[cutie.cafe].

Like what we're doing? Be sure to give us some 👍s above!
7 Comments
ミTᏔi𐌔T𐌄𐌃 25 Feb @ 5:01pm 
:orwell_relationship: :orwell_relationship: :orwell_relationship:
SpongeCake 15 Feb, 2018 @ 1:58pm 
if qtc_headcrab_crab is set to 0 I get this error message:
[Pocket Headcrab] lua/entities/pocket_headcrab.lua:47: bad argument #1 to 'Create' (string
expected, got nil)
1. Create - [C]:-1
2. unknown - lua/entities/pocket_headcrab.lua:47

Timer Failed! [Simple][@lua/entities/pocket_headcrab.lua (line 42)]

if it is set to 1 it spawns normal, 2 spawns poison and 3 spawns random

qtc_headcrab_count = spawn a maximum of 5 and they spawn inside of each other which renders them immobile. Maybe set up a radius from the center of the explosion in which they can spawn based on some random location generator?

qtc_headcrab_limitedstock = 0 sets unlimited, 1-5 gives one

qtc_headcrab_slot = they index from 0 but setting this to 4 puts the pocket headcrab into grenade slot and in the menu shows as item 5
Goblin Conscript 18 Dec, 2017 @ 3:32pm 
I have a problem with the mod. When I'm T I accidentally pick grenades up, and it says I cannot buy the headcrab with a grenade, so I threw it away, and It still says I can't get it
fskin 8 Jun, 2017 @ 4:23am 
I have a lot of addons so there might as well just be conflicts, don't worry about it.

Your weapon is the best NPC spawning base I've found so far so I'm still using it!
alex / my 📱 is my 📡  [author] 7 Jun, 2017 @ 5:36pm 
That's weird, none of that came up in my internal testing. If the multiple headcrabs don't show up, keep in mind that I don't really spawn them too well so it might look like they overlap. I'll hopefully look into it sometime within the next week. Sorry about that!
fskin 5 Jun, 2017 @ 2:57am 
Oh and also it should just be set to WEAPON_NADE by default because no matter what slot is specified, it's not buyable as long as I have a main weapon. It somehow keeps setting to WEAPON_HEAVY, apparently.
fskin 5 Jun, 2017 @ 2:56am 
Headcrab count is inconsistent, won't spawn more than 5 most of the time and sometimes just spawns less for some reason.

Headcrab health doesn't really work it seems? They still die with 1 shot, no matter what's specified. Perhaps it only works for regular headcrabs but I've disabled those.