Setting ImageLabel Image not working

I’m trying to make it so the user can change an image label’s image, but when I enter the ID, nothing happens and returns this error with the current form I’m using: Image https://assetdelivery.roblox.com/v1/asset?id=5365990751 failed to load. Error 403: Asset type does not match requested type

I’ve also tried: rbxassetid://…“Userinputtedidhere” and just putting the id in plain.

It’s being set by a text box that puts the text into the image property of an image label, but it is not changing.

However, when I set it manually in the studio (no playtest) it sets the image, using the same ID

1 Like

That’s the ID of the decal not the image asset, try using “5365990711” instead.

ImageLabel.Image = "rbxassetid://5365990711"

i’ve tired that. any form of entering the ID I try it just won’t update.

image

Works fine for me.

Perhaps provide the script you’re working with, there’s likely some other issue at hand.

no, there’s no errors and every other part of the script works perfectly… maybe it’s just roblox?

Well the image works perfectly fine for me, so it must be an issue with your script.

I’ve noticed some decals need to be applied with http://www.roblox.com/asset/?id=<ID>. The weird thing is the ID is not the same as the decal’s ID. It might be related to who owns the decal, but other than that I can’t find any patterns.
Probably not the most helpful information, but maybe it’ll point you in the right direction.

1 Like

whats the difference between the two

if i use http://www.roblox.com/asset/?id= it returns
image

That’s because you’re trying to use the decal ID instead of the image ID.
Instead try:

imageLabel.Image = string.format("rbxthumb://type=Asset&id=%s&w=420&h=420", Decal_ID)

Ill give that a shot when i get back on my computer, and let you know how that turned out.

That’s because Roblox uses asset ids to load images, not the ones visible on the website. When you copy paste an id inside a decal/image Roblox does the conversion automatically, although that’s not true for live in-game servers. An easy fix to your issue is to use the thumbnail endpoint to show the image:

ImageLabel.Image = "rbxthumb://type=Asset&w=768&h=432&id="..userInput
12 Likes

awesome. This works, thank you so much!