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

How to use Content Provider with a bar stating how many assets need to be downloaded?

I have a script that doesn't seem to work, I don't know how to update my value on it. Help?



--//Locals
local ContentProvider = game:GetService("ContentProvider")
local AmountNeeded = game.ContentProvider.RequestQueueSize
local AmountNeeded2 = game.ContentProvider.RequestQueueSize
local Blur = Instance.new("BlurEffect")
local Size = 50
local BlurTable = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
	,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44
	,45,46,47,48,49,50}

function Changed()
	AmountNeeded2 = game.ContentProvider.RequestQueueSize
end
AmountNeeded.Changed:connect(Changed)

script.Parent.Text = (AmountNeeded2.." Assets needed to be downloaded")
if AmountNeeded <=0 then
	wait(1)
	script.Parent.Text = "Done!"
	Blur.Parent = game.Workspace.CurrentCamera
	for i,v in pairs (BlurTable) do
		wait(0.05)
		Blur.Size = v
	end
	script.Parent.Parent:TweenPosition(UDim2.new(0,0,-2,0),"Out", "Quad", 1.5)
	wait(7)
	while wait() do
		Blur.Size = Blur.Size - 1
		if Blur.Size <= 0 then
			Blur:Destroy()
		end
	end 
end


3 comments

0

Is it not updating?

0

updating the request queue size

0

CONTENTPROV:PreloadAsync()

1 answer

✓ Accepted answer
CONTENTPROV:PreloadAsync()

Maybe try this? Maybe it will work...

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