How can I make a Countdown on a SurfaceGui?

Hello! How can I make a Countdown on a SurfaceGui? Like how PSX Has it when they’re having an update, it shows a Countdown for let’s say 2 days, and after it ends it says something like “Rejoin!” How can I do this?

Any help will be appreciated! :slight_smile:

3 Likes

Here are some resources

3 Likes

Wait…

Do you want a script or example?

1 Like

Does Roblox do GMT For their time?

1 Like

Im not sure but I googled and found this.
How to get current time utc, gmt etc

1 Like

I would perfer a script, cause like who doesn’t.

1 Like

Create part at workspace.

Add SurfaceGui at the part.

and a textlabel at surfacegui too.

Add script at SurfaceGui. not under textlabel.

Took a part of it. and edited it.

Here’s the script:

--// Varabies:
local SurfaceGui = script.Parent
local TextLabel = SurfaceGui:WaitForChild("TextLabel")
--// Edits:

-- Amount of times:
wait()
local mFloor = math.floor
local Next = next
local Tick = tick
local Wait = wait
local Stop = 0
------------------
-- a loop for the time.
while true do Wait(1)
wait()
-- The times:
local Time = 45000 -- The time of day you want.
local Days = mFloor((Time / 60 / 60 / 24) % (365 + 0.2425)) 
local Hours = mFloor((Time / 60 / 60) % 24) 
local Mintues = mFloor((Time / 60) % 60) 
local Seconds = mFloor(Time % 60)
---------------
if Stop == 0 then -- If the timer stops.

TextLabel.Text =  Days.."D "..Hours.. "H "..Minutes.."M "..Seconds.."S"
end
----------------------
if Days==0 and Hours==0 and Minutes==0 and Seconds==0 then -- When everything done. will be changing the text!

Stop=1
TextLabel.Text = "REJOIN! [NEW UPDATE...]"

end
1 Like


I am getting that error.

if Days==0 and Hours==0 and Minutes==0 and Seconds==0 then – When everything done. will be changing the text!

Stop=1
TextLabel.Text = “REJOIN! [NEW UPDATE…]”

end
end

Okay yea that’s what I thought was wrong I fixed that after I sent the photo. I am now getting this error.


Also is the time in Unix Timestamp?

I don’t really know actually…

Ima fix bugs.

Take this one.

What do you not know about? The Unix Time or the Error?

The unix time.

I don’t really know it.

Oh then don’t worry about that, I should be able to figure it out fairly quickly.

Take this one.

I fixed some bugs.

Tell me. if worked.

Make you sure follow the steps i told you up. you can check it

local SurfaceGui = script.Parent
local TextLabel = SurfaceGui:WaitForChild("TextLabel")
--// Edits:

-- Amount of times:
wait()
local mFloor = math.floor
local Next = next
local Tick = tick
local Wait = wait
local Stop = 0
------------------
-- a loop for the time.
while true do Wait(1)
wait()
-- The times:
local Time = 45000 -- The time of day you want.
local Days = mFloor((Time / 60 / 60 / 24) % (365 + 0.2425)) 
local Hours = mFloor((Time / 60 / 60) % 24) 
local Minutes = mFloor((Time / 60) % 60) 
local Seconds = mFloor(Time % 60)
---------------
if Stop == 0 then -- If the timer stops.

TextLabel.Text =  Days.."D "..Hours.. "H "..Minutes.."M "..Seconds.."S"
end
----------------------
if Days==0 and Hours==0 and Minutes==0 and Seconds==0 then -- When everything done. will be changing the text!

Stop=1
TextLabel.Text = "REJOIN! [NEW UPDATE...]"

end
        end

Okay so it doesn’t seem to update? It stays as that.

Did you follow the steps.
the steps is:

Create part at workspace.

Add SurfaceGui at the part.

and a textlabel at surfacegui too.

Add script at SurfaceGui. not under textlabel.

Don’t rename anything.

Make you sure the text renamed to: TextLabel

And surfacegui renamed to: SurfaceGui

For some reason this is showing?

You just tapped at the line of script.

Edit script.

You will see a grey ball. at a line. click it

make you sure it’s gone not staying at the line.

oh okay thank you I pinned the wait() for some reason, but yea same thing. it’s stuck at that time.
image