Help with progress bar

So i have a scaling frame that i need to scale from 0 to 150 in a duration of RollTime (0.8 seconds)

The problem is, it’s inverted.
so instead of going from 0 to 150 it’s going from 150 to 0.

function module.StartCountDown(RollTime,TimeDisplay,dice)
	local function start()
		TimeDisplay.Visible = true
		local OGRollTime = RollTime
		local scale = 0
		game["Run Service"]:BindToRenderStep("Timer",Enum.RenderPriority.Last.Value -1, function(delta)
			RollTime -= delta
			
      
			local s = math.floor(RollTime % 60)
			local ms = math.floor(RollTime % 1 * 100) 

			if RollTime <= 0 then
				game["Run Service"]:UnbindFromRenderStep("Timer")
				TimeDisplay.Text = 0
				TimeDisplay.Visible = false
				dice.Parent.Size = UDim2.fromOffset(150,150)
			else
				TimeDisplay.Text = string.format("%02i.%02i",s,ms)
				dice.Parent.Size = UDim2.fromOffset(150, RollTime/OGRollTime  * 150)
			end
		end)
	end

	start()

end

This fixed the problem.
Altough i got a bit of a visual glitch i’d like to know how to fix.
I am gonna send a video of the issue real quick.
robloxapp-20241025-1524136.wmv (747.2 KB)

my way of doing this might be a bad way.

1 Like

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