So, I’m making a timer for my FPS game and logically, this code should work but it doesn’t. Can someone explain why? I know it’s this script because I’ve checked that the “Game” thingy did change. I tried while true do and I still had the same issue.
local RS = game:GetService("ReplicatedStorage")
script.Parent.Data.Game.Changed:Connect(function()
print("Change!")
if script.Parent.Data.Game.Value == true then
local counterfolder = RS.ACS_Engine.Counter
local mins = counterfolder.Minutes --Number value
local seconds = counterfolder.Seconds --Number Value
local secondsformatted = counterfolder.SecondsFormatted --String value
local total = counterfolder.Time --String value
repeat
wait(1)
if seconds.Value ~= 00 then
seconds.Value = seconds.Value -1
else
mins.Value = mins.Value -1
seconds.Value = 59
end
if seconds.Value < 10 then
print("OK")
secondsformatted.Value = "0"..seconds.Value
else
secondsformatted.Value = seconds.Value
end
total.Value = mins.Value..":"..secondsformatted.Value
until total.Value == "0:00"
else
print("What...")
end
end)