I removed the remote event part because I don’t have a remote event for the script and I thought it would work
local roundlength = 100
local intermissionlength = 0
local InRound = game.ReplicatedStorage.InRound
local Status = game.ReplicatedStorage.Status
local Camera = workspace.CurrentCamera
function ConvertClock(Time)
if Time ~= 1 or Time ~= 0 then
local minutes = math.floor(Time / 60)
local seconds = math.floor(Time % 60)
return {minutes, seconds}
else return Time end
end
function Timer(seconds)
for i = seconds, 0, -1 do
local minutes = math.floor(i/60)
local sec = math.floor(i%60) -- Optional
--return string.format("%02i:%02i", minutes, sec)
string.format("%02i:%02i", minutes, sec)
end
end
local function Teleport(Location)
if not workspace.Spawns:FindFirstChild(Location) then return end
for _, player in pairs(game.Players:GetPlayers()) do
local char = player.Character or player.CharacterAdded:wait()
char.HumanoidRootPart.CFrame = workspace.Spawns[Location].CFrame
end
end
InRound.Changed:Connect(function()
if InRound.Value == false then
Teleport("LobbyTP")
end
end)
local function roundTimer()
while wait() do
for i = intermissionlength, 0, -1 do
InRound.Value = false
wait(1)
Status.Value = "TIME: ".. i ..""
end
for i = roundlength, 0, -1 do
InRound.Value = true
wait(1)
Status.Value = "TIME: ".. i ..""
if i <= 0 then
Ended()
end
end
end
end
spawn(roundTimer)
function Ended()
for _, player in pairs(game.Players:GetPlayers()) do
pcall(function()
player.PlayerGui.EndGui.CameraHandler.Disabled = false
task.delay(5,function()
player.PlayerGui.EndGui.CameraHandler.Disabled = true
end)
end)
end
game.Workspace.Enemies:ClearAllChildren()
game.Workspace.Pickups:ClearAllChildren()
end
function ConvertClock(Time)
function ConvertClock(Time)
local minutes = math.floor(Time / 60)
local seconds = math.floor(Time % 60)
if tostring(seconds):len() == 1 then
seconds = tostring("0"..seconds)
end
return {tostring(minutes), tostring(seconds)}
end
for i = 1, 120 do
local c = ConvertClock(i)
print(c[1]..":"..c[2])
task.wait(1)
end
function Timer(seconds)
for i = seconds, 0, -1 do
local minutes = math.floor(i/60)
textLabel.Text = string.format("%02i:00", minutes) -- String.Format simply just formats the string. You would still need to change the text so define where your textLabel is and edit the text.
end
end
Try this instead, also the status value has to be an int value, or an number value that has only whole numbers.
local status = game.ReplicatedStorage.Status
local Time = script.parent.Time
function ConvertClock(Time)
local minutes = math.floor(Time / 60)
local seconds = math.floor(Time % 60)
if tostring(seconds):len() == 1 then
seconds = tostring("0"..seconds)
end
return {tostring(minutes), tostring(seconds)}
end
status.Changed:Connect(function()
local c = ConvertClock(status.Test)
Time.Text = c[1]..":"..c[2]
end)
Also I recommend putting the ConvertClock function inside a module script so you can use for another thing later.
local status = game.ReplicatedStorage.Status
local Time = script.parent.Time
function ConvertClock(Time)
local minutes = math.floor(Time / 60)
local seconds = math.floor(Time % 60)
if tostring(seconds):len() == 1 then
seconds = tostring("0"..seconds)
end
return {tostring(minutes), tostring(seconds)}
end
status.Changed:Connect(function()
local c = ConvertClock(tonumber(status.Test))
Time.Text = c[1]..":"..c[2]
end)