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

ContentProvider failed to load my assets that wouldn't load properly?

Asked by 6 years ago
Edited 6 years ago

So i had a question saying that i had a few images that failed to load by the server, so I tried making a script with the code provided by the Roblox Wiki.

I know my pictures were appropriate. They're just pictures of planets/space.

This code was in a LocalScript and this was what the wiki provided: (This was placed in ReplicatedFirst.)

local ContentProvider = gwame:GetService("ContentProvider")

-- load a bunch of assets
local assets = {968334406, 890538244, 879029658, 701954912}
for _, asset in ipairs(assets) do
    ContentProvider:Preload("http://www.roblox.com/asset/?id=" .. asset)
end

-- wait for them to complete
while ContentProvider.RequestQueueSize > 0 do
    wait(0.1)
end

How I changed the script:

local ContentProvider = game:GetService("ContentProvider")

local player = game.Players.LocalPlayer
local gui = player.PlayerGui
gui.LoadingGui.BG.LoadingLabel.Text = "Loading Decals/Assets..."


local assets = {968334406, 890538244, 879029658, 701954912} --Coming soon: 879029658
for _, asset in ipairs(assets) do
    ContentProvider:Preload("http://www.roblox.com/asset/?id=" .. asset)
end

-- wait for them to complete
while ContentProvider.RequestQueueSize > 0 do
    wait(0.1)
end
gui.LoadingGui.BG.LoadingLabel.Visible = false

print("Assets Loaded")

Output:

CententProvider failed to load 'asset' http://www.roblox.com/asset/?id=968334406 CententProvider failed to load 'asset' http://www.roblox.com/asset/?id=968334406 CententProvider failed to load 'asset' http://www.roblox.com/asset/?id=968334406 ^ That wasn't exactly what the errors said, but it was close.

Images didn't load! What else do I do?

(My recent question)

IF YOU HAVE AN ANSWER BUT IT'S SMALL, PLEASE POST IT AS AN ANSWER, NOT A COMMENT!!

0
This always happens. Also, use :PreloadAsync, as it yields until the image is loaded, and :Preload is deprecated. hiimgoodpack 2009 — 6y
0
@hiimgoodpack First of all, thanks for reading the last sentence.. And :PreloadAsync didn't work either Chez_Guy 67 — 6y

Answer this question