Alternative for using InsertService to get Decal asset IDs

Hey guys,

So I have this problem. I’m trying to allow users to use whatever Decal they want for advertisements. In order to do so, I’m trying to make it as easy as possible to just copy/paste the URL of the Decal in question and then have the game load it in for them. I’ve got it working through InsertService, but just recently ran into this issue.

Basically, InsertService only loads assets if they are owned by the place owner or Roblox. Otherwise, I get an error that says “Asset is not trusted for this place.” The URL of Decals doesn’t give you the actual asset ID used to load the image associated. Therefore, how do I go about letting my players insert decals into my place that neither my group (the place owner) nor Roblox owns? I really just need an alternate way to get Decal asset IDs. Does anybody have any known methods for that?

1 Like

Yes, just create a decal and put the appropriate link + ID into the texture box.
I just grabbed a public image from Roblox and put it in a Decal to make sure they didn’t change things (and it does still work).

Here is a texture example.
http://www.roblox.com/asset/?id=275625338

Here was the link I used
https://www.roblox.com/library/275625339/galaxy-hair-roblox

I haven’t tested for GUIs recently. I assume they also work.

1 Like

It looks like that does work (and is very simple to do too btw, thank you), but I’m still getting either an Http 403 (Forbidden) error, or a simple “Asset failed to load” error, depending on how I implement it.

If I put in a new ImageLabel object, and then paste the URL into it, it seems to load fine. It’s just when I do it live that it seems to have issues.

Is it just not possible for a client to request a Decal from Roblox’s servers if they don’t own it?

Decal IDs on the library is different from the decal itself. It’s really hard to predict what ID it is corresponding correctly.

Additionally, InsertService blocks off non-owned assets or assets that you did not make.

The extra steps are that, in circumstances that the decal is open-sourced, you can use a workaround to get the correct decal.

I haven’t tried loading it in a live game with code, but I assume that’s not an issue.

Note that sometimes you need to keep adding 1 or subtracting 1 from the ID until the image comes up. If the regular URL says 539, the asset ID could be something like 545.

Yes, that is the general idea. What I’m looking for are those “extra steps” you mentioned, as I haven’t been able to figure anything out thus far.

Loading it in a live game with code is where the issue occurs. I cannot rely on adding or subtracting any numbers from the ID given, as I have no way of programming it to know what image/decal the player is actually after using that method.

I suppose you could ask the user to verify that the image is what they want. They’re all moderated, so it won’t be a bad image.

Maybe you can try using pcall to try the IDs, I’m not sure if it throws an error if it doesn’t load.

Errors are thrown if it doesn’t load, but that’s still a very “jerry-rigged” kind of solution. I’d rather find a reliable solution that doesn’t involve guesswork or user confirmation.

Ok, good luck.

Be sure to test out what I said about the IDs, because for all I know maybe they changed things and you don’t need to ±1 anymore.