diff --git a/Example/Lua/traitormod/autorun/traitormod.lua b/Example/Lua/traitormod/autorun/traitormod.lua index aecadd05a..ed20f6d99 100644 --- a/Example/Lua/traitormod/autorun/traitormod.lua +++ b/Example/Lua/traitormod/autorun/traitormod.lua @@ -6,7 +6,6 @@ traitormod.selectedCodeResponses = {} traitormod.selectedCodePhrases = {} traitormod.enabled = true -traitormod.traitorShipEnabled = true traitormod.roundGamemode = "" local traitorAssignDelay = 0 @@ -255,7 +254,7 @@ Hook.Add("roundStart", "traitor_start", function() local rng = Random.Range(0, 100) - if rng < config.traitorShipChance and traitormod.traitorShipEnabled == true then + if rng < config.traitorShipChance and config.traitorShipEnabled == true then local amount = config.getAmountShipTraitors(#util.GetValidPlayers()) Game.Log("Infiltraiton Gamemode selected, Random = " .. rng, 6) @@ -269,7 +268,9 @@ Hook.Add("roundStart", "traitor_start", function() Game.Log("Assasination Gamemode was selected, Random = " .. rng, 6) traitormod.roundGamemode = "Assasination" - traitormod.spawnTraitorShipAndHide() + if config.traitorShipEnabled then + traitormod.spawnTraitorShipAndHide() + end end for key, value in pairs(Player.GetAllClients()) do @@ -387,9 +388,9 @@ Hook.Add("chatMessage", "chatcommands", function(msg, client) end if msg == "!toggletraitorship" then - traitormod.traitorShipEnabled = not traitormod.traitorShipEnabled + config.traitorShipEnabled = not config.traitorShipEnabled - if traitormod.traitorShipEnabled then + if config.traitorShipEnabled then Game.SendDirectChatMessage("", "Traitor Ship Enabled", nil, 1, client) else @@ -397,6 +398,8 @@ Hook.Add("chatMessage", "chatcommands", function(msg, client) client) end + Game.OverrideRespawnSub(config.traitorShipEnabled) + return true end diff --git a/Example/Lua/traitormod/autorun/traitorship.lua b/Example/Lua/traitormod/autorun/traitorship.lua index 50bc493de..34b9225ae 100644 --- a/Example/Lua/traitormod/autorun/traitorship.lua +++ b/Example/Lua/traitormod/autorun/traitorship.lua @@ -5,7 +5,7 @@ local loadedpeople = {} local config = dofile("lua/traitormod/traitorconfig.lua") local util = dofile("lua/traitormod/util.lua") -Game.OverrideRespawnSub(true) +Game.OverrideRespawnSub(config.traitorShipEnabled) Hook.Add("think", "traitorShip", function() if respawnshuttle ~= nil then diff --git a/Example/Lua/traitormod/traitorconfig.lua b/Example/Lua/traitormod/traitorconfig.lua index e132c3c19..82e96fc30 100644 --- a/Example/Lua/traitormod/traitorconfig.lua +++ b/Example/Lua/traitormod/traitorconfig.lua @@ -12,9 +12,12 @@ config.codewords = codewords config.amountCodewords = 2 config.traitorSpawnDelay = 60 config.nextMissionDelay = 60 + +config.traitorShipEnabled = true -- set this to false for the respawn shuttles to work config.traitorShipChance = 15 config.traitorShipGodModeDistance = 4000 + -- Traitor Selection Options config.roundEndPercentageIncrease = 10 config.firstJoinPercentage = 10 @@ -23,11 +26,11 @@ config.traitorPenalty = 5 -- >=12 players = 3 traitors, >=8 players = 2 traitors, default = 1 traitor config.getAmountTraitors = function (amountClients) - if amountClients >= 12 then return 3 end + if amountClients >= 12 then return 3 end -- if theres 12 or more players, 3 traitors will be selected - if amountClients >= 8 then return 2 end + if amountClients >= 8 then return 2 end -- if theres 8 or more players, 2 traitors will be selected - return 1 + return 1 -- if theres less than 8 players, there will only one traitor end -- shipTraitors and normal traitors will be selected equally