Image https://assetdelivery.roblox.com/v1/asset?id=7103055634 failed to load. Error 403: Asset type does not match requested type

Recently, I have spent time scripting a system that loops through each image ID, switching the image label’s image to it and emulating the behaviour of a video. However, I keep getting the following error:

  15:39:33.616  Image https://assetdelivery.roblox.com/v1/asset?id=7103055634 failed to load. Error 403: Asset type does not match requested type  -  Studio

Code:

local idTable = {} --A lot of IDs go in here in the actual script
local imageLabel = script.Parent
local ContentProviderService = game:GetService("ContentProvider")
local sound = script.Parent:WaitForChild("Sound")
local preloadedCount = 0
local function UpdateDone()
	preloadedCount += 1
	script.Parent.Parent.Background.TextLabel.Text = "Loading... Preloaded "..preloadedCount.." so far..."
end
for _, ID in pairs(idTable) do
	ContentProviderService:PreloadAsync({"rbxassetid://"..ID}, UpdateDone)
end
local counter = 1
local lastLoadedId 
script.Parent.Parent.Background.Visible = false
sound.Playing = true
while sound.Playing == true do
	script.Parent.Image = "rbxassetid://"..idTable[counter]
	wait()
end

Help?

It’s because the script needs the asset image id, instead of the decal id, I see you’re using rbxassetid:// already, but images asset id (or contentid) are not always formatted as rbxassetid://, a better method would be using rbxthumb://:

string.format("rbxthumb://type=Asset&id=%s&w=420&h=420", ID)
1 Like

But now when I set the image to that it stays a black screen. Current code:

local preloadedCount = 0
local function UpdateDone()
	preloadedCount += 1
	script.Parent.Parent.Background.TextLabel.Text = "Loading... Preloaded "..preloadedCount.." so far..."
end
for _, ID in pairs(idTable) do
	ContentProviderService:PreloadAsync({string.format("rbxthumb://type=Asset&id=%s&w=420&h=420", tostring(ID))}, UpdateDone)
end
local counter = 1
local lastLoadedId 
script.Parent.Parent.Background.Visible = false
sound.Playing = true
while sound.Playing == true do
	script.Parent.Image = string.format("rbxthumb://type=Asset&id=%s&w=420&h=420", tostring(idTable[counter]))
	wait()
end

Don’t tostring() the id. 30 kars

No difference, still fully black screen for some reason. Could the preloading be a factor?

Change this

to this: http://www.roblox.com/asset/?id=

1 Like

Ok. For the preloading part or both the setting and the preloading

Even worse, my output gets spammed with errors:

 Image https://assetdelivery.roblox.com/v1/asset?id=4207103112413 failed to load. Error 404: Request asset was not found

Only the part that loads the image changes

script.Parent.Image = "http://www.roblox.com/asset/?id="..idTable[counter]

also check that the ids is valid.

The link appears to be trying to access a decal. The file returned by that link is an XML file. The URL for your image appears to be http://www.roblox.com/asset/?id=7103055625.

It should be noted that clicking the above link will not bring you to the asset, but it should load your image in-game if that link is supplied to the decal.

So, what do I do? Try upload them as images?

Because I tried using that link and it didn’t return anything within the script.

Replace your current id (7103055634) with the new one (7103055625) and try it again.

no difference, returns error page… could this be a reason?

Are you using your original code or the codes provided? When I use your original code, if I plug the ID into your table and put it into a LocalScript parented to an ImageLabel, it changes the graphic to the correct image.

local idTable = {7103055625} --A lot of IDs go in here in the actual script
local imageLabel = script.Parent
local ContentProviderService = game:GetService("ContentProvider")
local sound = script.Parent:WaitForChild("Sound")
local preloadedCount = 0
local function UpdateDone()
	preloadedCount += 1
	script.Parent.Parent.Background.TextLabel.Text = "Loading... Preloaded "..preloadedCount.." so far..."
end
for _, ID in pairs(idTable) do
	ContentProviderService:PreloadAsync({"rbxassetid://"..ID}, UpdateDone)
end
local counter = 1
local lastLoadedId 
script.Parent.Parent.Background.Visible = false
sound.Playing = true
while sound.Playing == true do
	script.Parent.Image = "rbxassetid://"..idTable[counter]
	wait()
end

Hm, let me use the original code then. Thanks for clarifying