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 method of taking an AssetID and determining if it is an image, and loadable?

I'm finishing up a plugin that has the option to create decals, but in order to stop errors, I want to make sure that the asset being loaded IS an image. Are there any methods of doing this?

1 answer

✓ Accepted answer

LoadAsset may be the solution to that. Check if the loaded asset IsA decal, and then make sure that you use pcall just in case.

3 comments

0

something along the line of: if game:GetService("InsertService"):LoadAsset(Img):IsA("Decal") then ?

0

Using this code:

0

if game:GetService("InsertService"):LoadAsset(Img):IsA("Decal") then print("all cool") Tex.Image = AID.. Img else print("Wtf u doing fam, not an image. Its a "..game:GetService("InsertService"):LoadAsset(Img).ClassName) end

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