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