How do I make a timer like this one?

timer

The game is this

I want to make a timer like this, but I don’t know how they did it.

whAt do YOU WANt? the tween or the minutes:seconds formatting

Tween
  • set the frame’s ClipsDescendants on
  • each text gui must be individually placed

function:

local TweenService = game:GetService("TweenService")

local PlayingTweens = {}

local function ChangeText(Gui, NewText)
	local GuiPosition = Gui.Position
	
	for i, PlayingTween in ipairs(PlayingTweens) do if PlayingTween.Gui == Gui then PlayingTween.Tween:Cancel() GuiPosition = PlayingTween.Pos table.remove(PlayingTweens, i) end end
	
	local Tween = TweenService:Create(Gui, TweenInfo.new(0.5), {["Position"] = GuiPosition})
	local Index = table.getn(PlayingTweens) + 1
	
	Gui.Text = NewText
	Gui.Position = UDim2.new(GuiPosition.X.Scale, GuiPosition.X.Offset, -1, GuiPosition.Y.Offset)
	Tween:Play()

	table.insert(PlayingTweens, Index, {Gui = Gui, Tween = Tween, Pos = GuiPosition})
	
	Tween.Completed:Once(function()
		table.remove(PlayingTweens, Index)
	end)
end
Formatting
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.