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

How to change a decal's id?

Asked by 3 years ago
Edited 3 years ago

Hello. I am trying to make a custom image. So the user can provide an image id. And I can show it.

But the request keeps failing, can someone provide a better method?

I basically try to do this. lua Img.Image = "rbxassetid://"..Arguments[2] Arguments[2] is an image id. (String) Img is a decal.

2 answers

Log in to vote
1
Answered by 3 years ago

Odds are the image ID you're supplying is the ID that references the image, but not the ID of the image itself. I'll explain if you're confused with what I'm talking about.

If you go to the page for an image in, say, your inventory or the asset library, it will take you to the reference page. There is an icon next to the title of the image that takes you to the actual image page. The actual image page holds the actual image ID. The reference page holds the ID of the generic asset, which references the image but is not the image itself. ImageObject.Image requires the actual image ID in order to load that image.

Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Instead of rbxassetid://<id> you can use

rbxthumb://type=Asset&id=<id>&w=420&h=420

so it should be

Img.Image = "rbxthumb://type=Asset&id="..Arguments[2].."&w=420&h=420"
0
That wouldn't work. It would still be the same either way. Dovydas1118 1495 — 3y

Answer this question