What is the correct math i need to do to make a Global leaderboard update timer bar?

Quick question.

What is the correct math i should be using here to make the bar grow correctly?

Script:

Timer.Value = 10
	repeat
		Timer.Value = Timer.Value - 1
		UpdateUi.Size = UDim2.new(1/Timer.Value,0,0.05,0)
		wait(1)
	until Timer.Value == 0

The bar:
image

image

I know this might be a dumb question but when it comes to math, i am THAT bad

Timer.Value = 10
	repeat
		Timer.Value = Timer.Value - 1
		--UpdateUi.Size = UDim2.new(Timer.Value/10,0,0.05,0) --If you want it to go down;
		UpdateUi.Size = UDim2.new(1 - (Timer.Value/10),0,0.05,0) --If you want it to go up;
		wait(1)
	until Timer.Value == 0
1 Like

Thank you, i knew it was something simple but when it comes to math stuff i never know or remember the correct method.

1 Like