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

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

Asked by 8 years ago

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

Log in to vote
2
Answered by
ImfaoXD 158
8 years ago

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.

0
Thanks. It's hard to specifically navigate to this without help. randomsmileyface 375 — 8y
0
No problem, man. Have fun with the script! :) ImfaoXD 158 — 8y
Ad

Answer this question