example update

This commit is contained in:
Evil Factory
2021-04-17 23:04:13 -03:00
parent e8c99c14eb
commit 5991eef8df
3 changed files with 15 additions and 9 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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