Garry's Mod

Garry's Mod

Not enough ratings
TTT Loot Equipment
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Fun, Realism
File Size
Posted
Updated
32.303 KB
14 Sep, 2022 @ 1:33pm
14 Sep, 2022 @ 3:07pm
2 Change Notes ( view )

Subscribe to download
TTT Loot Equipment

In 1 collection by VladiMatt
TTT Stuff
8 items
Description
Uploaded with gmpublisher[gmpublisher.download]

Allows players to loot equipment from dead bodies. Made for original TTT (not 2 and I will not be adding support for it so please don't ask).
This should work with custom equipment that doesn't rely on any weird shenanigans to work (but it does attempt to accommodate shenanigans with the "lootequip_orderedhook" CVar)

CVars:
"lootequip_canloot"
(Who can loot bodies? Defaults to 2)
-1 = disabled
0 = Traitors only
1 = Detectives only
2 = Traitors and Detectives
3 = Everyone (will 100% cause shenanigans with custom equipment)

"lootequip_orderedhook"
(Run "TTTOrderedEquipment" hook? For use with some custom equipment. Defaults to 0 and should only be changed if you know you need it.)
0 = disabled
1 = enabled

Eventually I'd like to add an easily-configurable black/whitelist, but for now if you know Lua you can manually prevent looting an equipment by setting "preventLoot" on it to true. This goes for base equipment (terrortown/gamemode/equip_items_shd.lua) or custom equipment.
For example:
{
id = EQUIP_ARMOR,
type = "item_passive",
material = mat_dir .. "icon_armor",
name = "item_armor",
desc = "item_armor_desc",
preventLoot = true
}


I will absolutely fix bugs and try to enable compatibility with other equipment addons where I can, but I will not be providing any real support other than that.

If you're experienced with Lua you are more than welcome to modify this script for your server as you see fit, just don't reupload it anywhere.