I want make live countdown like to 14 GMT everyday.
Idk why but it is showing -0 maybe because I don’t know how to do that. I just want to countdown to 14 and when is 14 then show text until 15.
I tried to find that at forum but I didn’t find. Please help me
This model is from tutorial which I tried remake.
local countdownGui = script.Parent
local countdownText = countdownGui:WaitForChild("CountdownText")
local secondsBetween = os.time()
local seconds2 = secondsBetween % 60
local minutes2 = math.floor(secondsBetween % (60*60) / 60)
local hours = math.floor(secondsBetween % (60*60*24) / (60*60))
local textString = hours .. "h:" .. minutes2 .. "m:" .. seconds2 .. "s"
print(textString)
local Hours = 14 - hours
local minutes = minutes2
local seconds = seconds2
repeat
if hours == 14 then
countdownText.Text = "There is currently event!"
elseif hours ~= 14 then
if minutes <= 0 and Hours ~= 0 and seconds == 0 then
Hours = Hours - 1
minutes = 59
seconds = 59
elseif seconds <= 0 then
minutes = minutes - 1
seconds = 59
else
seconds = seconds - 1
end
if seconds <= 9 and Hours <=9 and minutes <= 9 then
countdownText.Text = "0"..tostring(Hours)..":0"..tostring(minutes)..":0"..tostring(seconds)
elseif seconds <= 9 and Hours >=10 and minutes <= 9 then
countdownText.Text = tostring(Hours)..":0"..tostring(minutes)..":0"..tostring(seconds)
elseif seconds >= 10 and Hours >=10 and minutes <= 9 then
countdownText.Text = tostring(Hours)..":0"..tostring(minutes)..":"..tostring(seconds)
elseif seconds >= 10 and Hours >=10 and minutes >= 10 then
countdownText.Text = tostring(Hours)..":"..tostring(minutes)..":"..tostring(seconds)
elseif seconds >= 10 and Hours <=9 and minutes <= 9 then
countdownText.Text = "0"..tostring(Hours)..":0"..tostring(minutes)..":"..tostring(seconds)
elseif seconds >= 10 and Hours <=9 and minutes >= 10 then
countdownText.Text = "0"..tostring(Hours)..":"..tostring(minutes)..":"..tostring(seconds)
elseif seconds <= 9 and Hours <=9 and minutes >= 10 then
countdownText.Text = "0"..tostring(Hours)..":"..tostring(minutes)..":0"..tostring(seconds)
elseif seconds <= 9 and Hours >=10 and minutes >= 10 then
countdownText.Text = tostring(Hours)..":"..tostring(minutes)..":0"..tostring(seconds)
end
end
wait(1)
until minutes <= 0 and seconds <= 0 and Hours <= 0
^Time on photo: 15:11