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

Is there a way to check if a decal is loaded?

Lets say for example you use a lot of image decals. Usually they can take a long time to load, especially on first startup of a game.

This will cause a decal to give a grey screen until it is properly accessed by the server. Is there a way you can put a text decal where the image decal should be until it loads?

1 answer

✓ Accepted answer

You can use this to load almost everything that have IDs, except model.

local ContentProvider = Game:GetService("ContentProvider")
 
local function LoadAssets(AssetList)
	-- Takes an asset list and preloads it. Will not wait for them to load. 
 
	for _, AssetId in pairs(AssetList) do
		ContentProvider:Preload("http://www.roblox.com/asset/?id=" .. AssetId)
	end
end
 
LoadAssets({2253543, 2434541, 5133543, 2423433, 41143243, 2453865, 21433365, 2154549})

You can go this link to learn more information about it:

http://wiki.roblox.com/index.php?title=API:Class/ContentProvider/Preload

I hope this helps.

2 comments

0

Thanks. It's hard to specifically navigate to this without help.

0

No problem, man. Have fun with the script! :)

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