Garry's Mod

Garry's Mod

Custom Roles for TTT [OUTDATED]
Dee 19 Oct, 2019 @ 9:05am
Is there any way to make TTT workshop weapons available to other traitor roles?
Hey, this mod is basically perfect and I gotta thank ya'll for making it. I just have one question: is there any way I can make it so that I can give other traitor-team roles the ability to buy workshop weapons? I found that if I ever want to buy these weapons, I have to "ttt_force_traitor" myself and open the shop for them to appear. Any way I can avoid having to do this if I want to use other weapons as, say, a vampire or zombie or hypnotist, etc.
< >
Showing 1-2 of 2 comments
SniperTheNoodle 26 Dec, 2019 @ 5:41pm 
i believe this is on purpose its to balance their op traits
HYDRAVOLT 25 Jan, 2020 @ 4:50pm 
you would have to decomplie the workshop addon and add the roles to the swep's shared.lua file, ie:
...
if (GetConVar("ttt_jihad_buyable"):GetBool()) then
-- CanBuy is a table of ROLE_* entries like ROLE_TRAITOR and ROLE_DETECTIVE. If
-- a role is in this table, those players can buy this.
SWEP.CanBuy = { ROLE_TRAITOR } // <--------- @HERE IS WHERE YOU ADD IT

-- If LimitedStock is true, you can only buy one per round.
SWEP.LimitedStock = true
end
...
I don't know the roles enumerator tho. this is an excerpt from the jihad bomb file, but all weapons have this section
< >
Showing 1-2 of 2 comments
Per page: 1530 50