My thoughts on the audio & In-depth review - maybe its not so bad? + While true timer not working

**Scroll all the way down to see My thoughts on the audio & In-depth review - maybe its not so bad?
While true timer not working:

how do i make a timer that’s the same on all servers and is always counting down even when no server are on?
unknown
heres my script:

local timeToEnd =  os.time({year=0, day=7, month = 0,hour=0, second=0})
while os.date("%X",os.time()) <= timeToEnd do
    script.parent.Text = os.date("%X",os.time())
    wait(1)
end

however i keep getting this error:
Players.SakDevRblx.PlayerGui.ScreenGui.Passes.Frame.Passes.Frame.Frame.Frame.AA.TextLabel.LocalScript:4: attempt to compare string <= nil

My thoughts on the audio issue:

Roblox deleted so many of my audios for copyright and I don’t have an ID verified account. i would rather pay Robux just so I don’t have to verify my ID! I can only upload 10 audios now which is not enough for all the accessories. not the mention i can only use stock music???

if someone has a music game pass they cant access it now?
I believe Roblox shouldn’t be releasing this update or at least have an option to toggle this update.
this update will make countless users quit the platform forever.

this is not the only time where Roblox has done wrong. for example the GREEDY DEVX rates.
Roblox thinks its ok to take 90% of my games revenue and now this?

1 Like

cant use a date earlier than 1970, Jan 1 or os.time returns nil
os (roblox.com)

2 Likes
local timeToEnd = os.time({year=2022, day=6, month = 9,hour=9, second=9})
print(os.date("%X",os.time()))
print(timeToEnd)
while tonumber(os.date("%X",os.time())) <= timeToEnd do
script.parent.Text = os.date("%X",os.time())
wait(1)
end

ok so i changed it and it was saying attemp to compare number to string. when i print it out it prints
image
so im guessing that the “:” is making it unable to be a number. one thing i want to note though is even if i removed the “:” it wouldnt work correctly as one is neatly organized and the other is seconds total

1 Like

Multiply the hh:mm:ss formatted time string into a seconds formatted number, you can achieve this via the following function I wrote.

local function timeToSeconds(stringTime)
	local splitTime = stringTime:split(":")
	local hoursToSeconds = tonumber(splitTime[1]) * 3600 --3600 seconds in an hour.
	local minutesToSeconds = tonumber(splitTime[2]) * 60 --60 seconds in a minute.
	local secondsToSeconds = tonumber(splitTime[3]) --No multiplication required.
	local totalSeconds = hoursToSeconds + minutesToSeconds + secondsToSeconds
	return totalSeconds
end

local timeInSeconds = timeToSeconds("00:16:09")
print(timeInSeconds) --969

i ended up writing this code. the issue was for some reason Os.Date wasnt going over 18 hours so i had to make my own formatter.


local timeToEnd = 1647056759

if timeToEnd > os.time() then
	local function Format(seconds)
		print(_GCounter)
		if _GCounter < 10 then 
			return _GCounter
		elseif _GCounter < 100 then
			return string.format("%02i:", seconds%60)
		elseif _GCounter < 1000 then	
			return string.format("%02i:%02i", seconds/60%60, seconds%60)
		else
			return string.format("%02i:%02i:%02i", seconds/3600, seconds/60%60, seconds%60)
		end
end

while true do task.wait(1)
		 _GCounter = timeToEnd - os.time()
	
		if _GCounter == 0 then
		script.Parent.Visible = false
		script.Parent.Parent.price.TextLabel.Visible = false
		script.Parent.Parent.price.Text = "$R " ..  script.Parent["Normal Price"].Value
		break
	else
			script.Parent.Text = Format(_GCounter) 
		end
	end
else
	script.Parent.Visible = false
	script.Parent.Parent.price.TextLabel.Visible = false
	script.Parent.Parent.price.Text = "$R " ..  script.Parent["Normal Price"].Value
end


--local timeToEnd = os.time() + length