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

How would I make this loading screen actually work? (I suck at math)

Asked by 4 years ago
Edited 4 years ago
local service = game:GetService("ContentProvider")
wait(0.1)
local start = service.RequestQueueSize

while wait() do

    warn(service.RequestQueueSize/start)
    if service.RequestQueueSize > 0 then
        script.Parent.bruh.Frame.Size = UDim2.new((service.RequestQueueSize/start), 0,(service.RequestQueueSize/start),0)
    end
end

Output:

 18:50:38.478 - 1
  18:50:38.512 - 0.88888888888889
  18:50:38.613 - 0.80555555555556 (x2)
  18:50:38.656 - 0.69444444444444
  18:50:38.723 - 0.61111111111111 (x2)
  18:50:38.759 - 0.47222222222222
  18:50:38.795 - 0.44444444444444
  18:50:38.840 - 0.36111111111111
  18:50:38.883 - 0.25
  18:50:38.927 - 0.19444444444444
  18:50:38.971 - 0.11111111111111
  18:50:39.123 - 0.027777777777778 (x4)
  18:50:45.021 - 0 (x158)

How would I make it go from 0 to 1 instead of 1 to 0?

Answer this question