Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago
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.

Ad

Answer this question