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

Is there a method of taking an AssetID and determining if it is an image, and loadable?

Asked by
Edenojack 171
8 years ago

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

Log in to vote
1
Answered by 8 years ago

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.

0
something along the line of: if game:GetService("InsertService"):LoadAsset(Img):IsA("Decal") then ? Edenojack 171 — 8y
0
Using this code: Edenojack 171 — 8y
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 Edenojack 171 — 8y
Ad

Answer this question