Many hours writing a couple lines and during my first tests, this came up:
local Duration = 480
local TPLEORET = Vector3.new(-28.5, 0.5, 37.5)
local RS = game:GetService("ReplicatedStorage")
local SS = game:GetService("ServerStorage")
local Event = RS:WaitForChild("MapChangerClient")
local Event2 = RS:WaitForChild("MapChangerServer")
local ValueFolder = workspace:FindFirstChild("Game")
local findFirstChild = game.FindFirstChild
function TimeRun(TempoRecebido)
return TempoRecebido - 1
end
function Intervalo(Polar, Map)
--[[CHECKING VALUE FOLDER]]
if ValueFolder~=nil then
local Time = findFirstChild(ValueFolder, "Time")
local Generators = findFirstChild(ValueFolder, "Generators")
local Pages = findFirstChild(ValueFolder, "Pages")
local Maps = findFirstChild(ValueFolder, "Map")
local STATE = findFirstChild(ValueFolder, "RoundON")
--[[CHECK VALUES]]
if Time and Generators and Pages and Maps and STATE then
-- RESET EVERYTHING
Time.Value = 30
Generators.Value = 0
Pages.Value = 0
Maps.Value = ""
STATE.Value = Polar
while Time.Value>0 do
Time.Value = TimeRun(Time.Value)
end
end
end
end
function Partida_Inicio(Polar, Map)
--[[CHECKING VALUE FOLDER]]
if ValueFolder~=nil then
local Time = findFirstChild(ValueFolder, "Time")
local Generators = findFirstChild(ValueFolder, "Generators")
local Pages = findFirstChild(ValueFolder, "Pages")
local Maps = findFirstChild(ValueFolder, "Map")
local STATE = findFirstChild(ValueFolder, "RoundON")
--[[CHECK VALUES]]
if Time and Generators and Pages and Maps and STATE then
if STATE == true then
Time.Value = 31
Generators.Value = 0
Pages.Value = 0
Maps.Value = Map
STATE.Value = false
else
Time.Value = 30
Generators.Value = 0
Pages.Value = 0
Maps.Value = ""
STATE.Value = true
end
end
end
end
function Partida_Fim(Polar, Map)
end
function CHECK(PAGES, GENERATORS, TIME)
return (PAGES == 8), (GENERATORS==3), (TIME<1)
end
--{{SYSTEM STAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARTTTTT}}
while true do
warn("ROUND SYSTEM STARTING")
--[[CHECKING VALUE FOLDER]]
print("Checking Values")
if ValueFolder~=nil then
local Time = findFirstChild(ValueFolder, "Time")
local Generators = findFirstChild(ValueFolder, "Generators")
local Pages = findFirstChild(ValueFolder, "Pages")
local Maps = findFirstChild(ValueFolder, "Map")
local STATE = findFirstChild(ValueFolder, "RoundON")
--[[CHECK VALUES]]
if Time and Generators and Pages and Maps and STATE then
print("VALUES = SUCCESS")
print("CHECKING ROUND")
if STATE.Value == true then
print("ROUND ON, CHECKING STATUS")
local PC, GC, Ti = CHECK(Pages.Value, Generators.Value, Time.Value)
print("Pages: "..Pages.Value.. " / Generators: " ..Generators.Value)
print(PC)
print(GC)
if Ti == true then
if PC == true and GC == true then
warn("Sobreviventes Vencem")
Intervalo(false, "")
warn("Intervalo")
else
warn("Monstros Vencem")
Intervalo(false, "")
warn()
end --line 125
else
if PC == true and GC == true then
warn("Sobreviventes Vencem")
Intervalo(false, "")
warn("Intervalo")
else
Time.Value = TimeRun(Time.Value)
end --line 125
end --line 124
end --line 118
if STATE.Value == false then
Intervalo(false, "")
end
end --line 115
else break
end --line 107
end --line 103