The aim here is to make a countdown that displays itself on the players GUI. for that reason this script is in StarterGui -> ScreenGui -> TextLabel
local CurrentTime = os.time()
local EndTime = CurrentTime + 60 -- 60 seconds past CurrentTime
local TimeLeft = EndTime - CurrentTime -- Time remaining on the clock
Player = game.Players.LocalPlayer --for adding gamepass later on, ignore
local MarketplaceService = game:GetService("MarketplaceService") --for adding gamepass later on, ignore
while true do -- while loop
if TimeLeft == 0 or os.clock == EndTime then --end of countdown
script.Parent.Text = "End of countdown." -- script.Parent is a TextLabel
else
script.Parent.Text = tostring(TimeLeft) -- script.Parent is a TextLabel
local TimeLeft = EndTime - os.time
end
end
Instead of displaying the correct amount of time, counting down in seconds, it displays 60

2 comments
I replaced break with i = 60 because I need this countdown to loop itself multiple times
put [SOLVED] in your question title since you already solved it