local InRound = game:WaitForChild("ReplicatedStorage"):WaitForChild("InRound")
local Statut = game:WaitForChild("ReplicatedStorage"):WaitForChild("Status")
local Color = game:WaitForChild("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Color")
local ColorDisplay = game:WaitForChild("ReplicatedStorage"):WaitForChild("Others"):WaitForChild("ColorDisplay")
local Intermissions = script.Parent.Intermissions
local ColorTable = require(game.ReplicatedStorage:WaitForChild("Modules"):WaitForChild("Configuration"))["Rounds Configuration"].ColorsTable
local Color3Table = {
["Yellow"] = Color3.fromRGB(255, 255, 0);
["Red"] = Color3.fromRGB(255, 0, 0);
["Blue"] = Color3.fromRGB(0, 0, 255);
["Green"] = Color3.fromRGB(0, 255, 0);
["Pink"] = Color3.fromRGB(255, 102, 204);
["Cyan"] = Color3.fromRGB(0, 255, 255);
["Purple"] = Color3.fromRGB(107, 50, 124)
}
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = 20
function abbreviateNumber(number)
local abbreviations = {"K", "M", "B", "T", "Qa", "Qi", "Sx", "Sp", "Oc", "No", "Dc", "UDc", "DDc", "TDc", "QaDc", "QiDc", "SxDc", "SpDc", "ODc", "NDc", "V", "UV", "DV", "TV", "QaV", "QiV", "SxV", "SpV", "OV", "NV"}
local power = math.floor(math.log10(number) / 3)
local abbreviation = abbreviations[power]
if abbreviation then
local abbreviatedNumber = number / (10^(power * 3))
local formattedNumber = string.format("%." .. (abbreviatedNumber % 1 == 0 and 0 or 2) .. "f%s", abbreviatedNumber, abbreviation)
return formattedNumber
else
return tostring(number)
end
end
Intermissions.Text = Statut.Value
local keys = {}
for key, _ in pairs(ColorTable) do
table.insert(keys, key)
end
InRound:GetPropertyChangedSignal("Value"):Connect(function()
if InRound.Value == true then
local CloneColorDisplay = ColorDisplay:Clone()
CloneColorDisplay.Parent = script.Parent
while true do
local randomKey = keys[math.random(1, #keys)]
if CloneColorDisplay ~= nil then
CloneColorDisplay.BackgroundColor3 = Color3Table[randomKey]
CloneColorDisplay.ColorText.Text = randomKey
for i = 5, 0, -1 do
CloneColorDisplay:WaitForChild("Timer").Text = i
wait(1)
end
Color:FireServer(randomKey, true)
task.wait()
for i = 3, 0, -1 do
if CloneColorDisplay.Timer then
CloneColorDisplay.Timer.Text = i
task.wait(1)
end
end
Color:FireServer(randomKey, false)
end
task.wait()
end
else
for _, Frame in pairs(script.Parent:GetChildren()) do
if Frame:IsA("Frame") and Frame.Name == "ColorDisplay" then
Frame:Destroy()
end
end
end
end)
Statut:GetPropertyChangedSignal("Value"):Connect(function()
Intermissions.Text = Statut.Value
end)