Most people on these forums have other commitments and thus have a limited amount of time to spend helping people. To make the most use of this time, it is very helpful if you specify what the issue you're having is: What you expect the code to do, what is happening instead, any pertinent errors, etc. Doing this is little extra work on your part, and greatly increases the chances of getting a response.
Since your code has no syntax errors and I do not know what you want this code to do (it seems to me that it will display a message if there is one innocent/detective and one or more traitors left), I cannot help you with that aspect.
As for where you should place this file: it depends. Sorry for the vague reply, but again without more information I can't really help. When do you want this code to run? This code doesn't seem like it would make sense to run once the map loads, as nobody is assigned any roles at that point.
Hopefully you will clarify your issue so we can assist you better.
Sorry I am new to this forum.
Question 1: What I expect the code to do?
Answer: I expect the code to show the phrase "Gents Rule" across the center of the screen when there is only one innocent/detective alive and one or more traitors alive, because some players on my server who are new do not use this rule. I wont waste your time explaining it.
Question 2: What is happening/errors?
Answer: I have not run this code yet, simply because I do not know where it goes. Does it go in lua->autorun? Does it go in terrortown->gamemodes? I have no clue because Lua is like writing a paper in German to me. So I hope I can find out if this is a GMOD thing or a TTT thing, and then determine where I should place the file so that it executes.
Question 3: When do you want this code to run?
Answer: I want it to run when only one innocent or only one detective is alive and the rest of the player count is Traitors.
Here is example of how I want this code to work:
-3 Players alive
-2 are Innocents, 1 is Traitor
-1 Innocent dies
-"Gents Rule" appears in center of screen, possibly plays a sound
Again sorry for sounding too vague when I posted this. I usually don't mess with lua, and anything that I do is easily searchable online. But my player base is requesting stuff like this to get added, and because I am getting donations and such I feel obligated to fulfill their requests. Thank you.