Hi. This is a question regarding how I would get an estimated time from a specific value. For example say if my number was 5 and the game took 5 seconds to load all of its assets. How would I get an estimated value of that number? I have tried to subtract the variables, add them and nothing seems to give me an accurate result.

local myNumber = 5
[ code to get estimated value ]

Here is a script which I have been working on.

local estimatedTime = math.random(30,60)
repeat
local doWait = math.random(1,5)
estimatedTime = estimatedTime - doWait
loadingFrame.EstimatedTime.Text = "Estimated Time Remaining: "..estimatedTime.."s"
wait(doWait)
local offset = loadingFrame.ProgressBar.Frame.Size.X.Offset
local div = 250 / duration
loadingFrame.ProgressBar.Frame:TweenSize(UDim2.new(0, offset + div, 0, 3), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5)
count = count + 1
until count == duration

If anyone could help me out with this then I would greatly appreciate your help. Thanks! :)

3 comments

0

tick()

0

So I would do myNumber - tick()?

0

Try to see if that works first.