Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What would the equation be for calculating the size of a frame to match a timer's value?

This is my current code, TIMER is workspace.Timer, and TB is the target frame. I don't know the equation, so, please help. I'm very bad at math, so thank you.

while wait() do
	local timer = tonumber(TIMER.Value)
	local UD = timer / 0.1
	TB.Size = UDim2.new(0, UD, 0, 0)
end

Much appreciated, ~Sebby

1 answer

local TimerTime = 60

for i = TimerTime, 1, -1 do
    local timeLeft = i/TimerTime
    TB.Size = UDIM2.new(timeLeft, 0, 1, 0)
    wait(1)
end

This was what worked for me.

This discussion is preserved as it was. New answers, comments, and votes are closed.