Decal Request Failed

Working on a button where players can input Roblox decal IDs for a flag of their choice; however it does not work as intended:

09:48:26.453 - Image “https://assetdelivery.roblox.com/v1/asset?id=http://www.roblox.com/asset/?id=94535459” failed to load in “Workspace.basecamps.basecampdawdaw.flagspawn.flag.image.Texture”: Request failed

Wondering if I have to use “LoadAsset” insert service or possibly a typo…

This is a problem with roblox as when I import a model it appears because the model has decals

What is the id of the image that you attempted to enter? Remember that Roblox images have two ids: a decal id an an image id. The decal id is used for website information and the image id is used for rendering in-game.

image is whatever the decal image is inputted by the user; for testing purposes, I use this Decal ID: 94535459

Texture: “http://www.roblox.com/asset/?id=”…image

How would you know the differences between a decal and an image?

That’s a decal id, what you need is the image id. Luckily I was able to fetch it because by some miracle, the image id was only one number behind. Due to the volume of assets placed on the website, there are usually a lot of assets between the image and decal ids.

Use the following id: 94535458

For your game, you will want to consider a web API of some sort that is able to fetch the image id from a decal id. InsertService isn’t sufficient enough due to security implementations.

1 Like

Wow you’re right; it worked after I switched the ID. :smiley:

However, I’m not sure what a web API is; Care explaining?

Would it work everytime if I just subtracted 1 number from the user inputted ID like from: 94535459 to: 94535458 ?

1 Like

No. Some decals require a lot of subtraction to get the image id.

A web API allows you to make a call to a web server for it to run code and return a certain response. See this post for a relevant web API:

1 Like