---- Trouble in Terrorist Town--@-- It's time to find out why people think reconnecting work.--@-- Includes shouldn't affect too much.--@-- Same with ConVars.function GM:Initialize() --@--Boring startup junk -- For the paranoid --@-- The comment says "For the paranoid" This is a legitimate math randomseed --@-- This should make it so the math is 100% random. First strike against the myth math.randomseed(os.time()) --@-- More boring crapend--@-- Boring methods--@-- Removing methods that already know who is traitor--@-- BeginRound merely runs the SelectRoles method. No problem. function SelectRoles() --@-- Ok here it is, the big one. This decides it all. for k,v in pairs(player.GetAll()) do -- everyone on the spec team is in specmode if IsValid(v) and (not v:IsSpec()) then --@-- Ok, the above line really gets me suspicious. --@-- Now I could be a total dumbass, but I know that the spectating --@-- in TTT is partially faked. --@-- IsSpec probably checks for said fake spectatorship, --@-- and a rejoin might not make you a fake spectator --@-- therefore you get signed up for this --@-- I could be 100% wrong, however. -- save previous role and sign up as possible traitor/detective --@-- So now we have two tables. The list of choices for pickings --@-- and the previous roles for said pickings. table.insert(prev_roles[v:GetRole() or ROLE_INNOCENT], v) table.insert(choices, v) end v:SetRole(ROLE_INNOCENT) end --@-- Irrelevant lines --@-- Here we go! -- first select traitors local ts = 0 while ts < traitor_count do -- select random index in choices table local pick = math.random(1, #choices) --@-- This is legitly random --@-- However only picks from the choices table, which had to not be fake spectating. --@-- I hope I'm not spewing bullshit -- the player we consider local pply = choices[pick] -- make this guy traitor if he was not a traitor last time, or if he makes -- a roll --@-- Our first true indication of tomfoolery. You DO have a lesser chance if you were --@-- Traitor last time, and whether that is avoided by retrying could be a possibility. if (not table.HasValue(prev_roles[ROLE_TRAITOR], pply)) or (math.random(1, 3) == 2) then pply:SetRole(ROLE_TRAITOR) table.remove(choices, pick) ts = ts + 1 end end --@-- We're not here for detectives. Snipping time.end--@-- Well there we go.--@-- We only found two possible leads.--@-- 1. Problems with fake TTT spectating--@-- 2. Rejoining opts you out of prev_roles, giving you higher Traitor chance.--@-- Let's investigate numero uno!--@-- First off we gotta go and checkan out the IsSpec method.--@-- From another lua file...function plymeta:IsSpec() return self:Team() == TEAM_SPEC end--@-- Well, that's uneventful.--@-- It checks Team() and if it's like, TEAM_SPEC then it goes naww--@-- Let's go find Team()--@-- First interesting tidbit from player_ext.luafunction plymeta:SpawnForRound(dead_only) --@-- Snip if self:Team() == TEAM_SPEC then self:UnSpectate() end --@-- Snipend--@-- Second, from player.lualocal function SelectTeam() if GetRoundState() == ROUND_PREP then return TEAM_TERROR else return TEAM_SPEC endend--@-- ...--@-- Well, what this says is that when you first spawn into the game, you're either a spec or a terror.--@-- And most likely you'll be a spec, so therefore you'll return true on IsSpec()--@-- Which therefore means you won't be early-picked for Traitor status--@-- Making me 100% wrong. Yay.--@-- Thus leaving the only hope for this in the method UnSpectate()--@-- Which comes with Gmod.--@-- As for possibility number 1...--@-- GAME OVER YEAHHHHHHHHHHHHHHH--@-- And for number two, rejoining opts you out of prevroles.--@-- This would only theoretically help if you were traitor previously.--@-- So maybe, just maybe, if you were a traitor, retrying might help.--@-- Otherwise, this myth is bogus. BOGUS