Garry's Mod

Garry's Mod

[TTT/2] Role Defibrillator
14 Comments
mexikoedi  [author] 18 Oct, 2021 @ 10:11am 
The team should be copied now.
mexikoedi  [author] 9 Oct, 2021 @ 7:49am 
I tested it and it works for doppelganger and other roles. I didn't find the "Lovers" role but it should work too. If something is not working please create an Issue on GitHub. Read the description for more information.
KillerfoxyLP 8 Oct, 2021 @ 10:30am 
pls?
KillerfoxyLP 2 Oct, 2021 @ 11:40am 
i wanted to ask if its possible to make it that it copies the team too for like lovers,doppelganger
Fabii  [author] 23 Oct, 2020 @ 3:52am 
Yes, use the TTT2 shopeditor to configure who can buy it. Just type !shopeditor in chat, assuming you are superadmin on the server
Knochi 23 Oct, 2020 @ 12:27am 
Can the detective also buy it?
Tim | Mineotopia 19 Jun, 2020 @ 5:34am 
Ah, no, I asked you because I did not want to create another addon. If I find the time to do it, I'll open a pullrequest so you can update yours.

Yes, that's nice. But they contacted us! :))
Fabii  [author] 19 Jun, 2020 @ 3:07am 
@Tim | Mineotopia Due to corona my university semester is rather stressful, so it's definitely not going to happen for now. But the repository is public so if anyone is willing to do it, they can always go ahead and fork it or ask me to add them as collaborateur. I will handle pull requests, but I can't do it myself right now. Also congratulations on the collaboration with HandOfBlood, I saw that you assembled his collection :)
Tim | Mineotopia 6 Jun, 2020 @ 7:58am 
Hey Fabian, we've added many thing to the TTT2 revive functionality. It would be cool if you'd rework this defi as well based on these functions. Feel free to use my defibrillator as a base:

WS: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2115944312
GH: https://github.com/TTT-2/ttt2-wep_defi
ルネ | Lune 27 Dec, 2019 @ 11:50am 
amazing!
Fabii  [author] 22 Oct, 2019 @ 7:21am 
@Cuckoo I just updated it but I did not test it
Cuckoo 22 Oct, 2019 @ 1:55am 
@Fabian Thanks a bunch for the fast response and clear explanation- that all makes perfect sense! Happy to know that the Role Defib should still work as intended in multiplayer (to be honest, I probably would not have gotten around to checking otherwise- my first assumption was that the Role Defib had a bug, so I went ahead and disabled it).

This is only a suggestion (and I'm not sure precisely how this would be coded), but it could be worth adding a line of code to check if the current game is singleplayer, and if so, to skip/ignore the rest of the lua. Then it would still be possible to test new TTT items in singleplayer without having to disable/unsubscribe this addon in particular.

(There's no urgent need for something like this, of course- the obvious existing workaround, in light of your explanation, is simply to test any new items on an empty two-player game, rather than a singleplayer game. That's probably a more reliable/realistic approach to TTT item testing, anyway).
Fabii  [author] 21 Oct, 2019 @ 2:35pm 
@Cuckoo This is due to you testing it on singleplayer, it should work fine on multiplayer, so just go ahead and ignore it. I basically implemented that you can decide whether or not a player who was respawned should have access to his roles shop, because that can be quite overpowered in some cases. If you activate this feature a player will not be able to open the shop after respawning, but it is disabled by default. The error is due to the fact that when I check for a player, I check him using his steam id, but the steam id does not work in singleplayer.
Cuckoo 21 Oct, 2019 @ 10:42am 
Heads up - I subscribed and booted up a single-player game of TTT to configure the role defib, but I seem to be getting a script error. The error is only triggered when trying to buy an item (any item) from the shop, but it does prevent the item from being purchased:


File exists in two addons - possible conflicts! gamemodes/terrortown/gamemode/server/sv_shop.lua (Trouble in Terrorist Town 2 (Advanced Update) - v0.5.5b and [TTT/2] Role Defibrillator)

[ERROR] lua/gamemodes/terrortown/gamemode/sh_init.lua:8: bad argument #1 to "tostring" (value expected)
1. tostring - [C]:-1
2. Run - lua/gamemodes/terrortown/gamemode/sh_init.lua:8
3. unknown - gamemodes/terrortown/gamemode/server/sv_shop.lua:43
4. unknown - lua/includes/modules/concommand.lua:54


If you don't think the script error is down to an issue with the Role Defibrillator, but rather something I've borked up on my end, then any advice you might be able to give would be appreciated.