Image set by script wont load

Im not sure what im doing wrong, ive rad a ton of stuff about it and i cant fix it

why don’t you use: `"rbxassetid://{ID}"`?

i read that it does not work, also i tried it and it didnt work

but are you sure you uploaded this image as an asset?

the image is a public one so yes its uploaded

Maybe try tostring instead of tonumber.

  1. is Buffer a imageLabel.
  2. what is the ID variable. (whats its value)

Are you using the decal ID or the image ID? I’ve had an issue like this before and using image fixed it.

what is the diffrence?
charlimit

To be honest, I’m not too sure myself. It just worked for me before so I thought I’d suggest it in case it works for you.

ImageId is the actual picture; DecalId is just an api sorting method (used by Roblox, not the developer)

1 Like

well whats the visual diffrence? like are the IDs diffrent? im not sure how to use a ImageId or decalId

So how do i get an image Id then

rbxthumb://type=Asset&id=[TargetId]&w=[150]&h=[150]
Replace [TargetId] with your id

Ok just to tell u guys i just learned what im using are “AssetIds” i have no idea what the diffrence is but how do i get my imageId from assetId

There’s no engine api to fetch an ImageId from a DecalId for whatever reason :melting_face:

The easiest way is the use the BTRoblox extension since it allows you to go to the Image page from the decal page:

(Top right corner)

You can also grab the id from the “Images” selection in the creator dashboard:

However, this section contains every image (place icons, thumbnails, etc) that you’ve ever uploaded, so it may take a minute or two to find the image you need.

Both of these only work if the image you need was uploaded by you; if you’re allowing the user to input a custom image, neither method will work


You can try @RyosWill’s solution, however, that endpoint only returns a maximum 420 x 420 resolution for assets, which means if you’re using the image for something like a billboard, it’ll look really blurry

1 Like

is there no simple way to get an imageid from asset id

Not until the Roblox engineers implement some sort method for it

1 Like

Forgot to update this thread; you can use this now:

local InsertService = game:GetService("InsertService")

-- Takes in a user input containing the assetId of either a decal
-- or image and returns an image assetId string ready for use or an
-- empty string if no assetId could be found.
function getImageFromUserInputAsync(decalOrImageAssetUri: string): string
	local a, b = decalOrImageAssetUri:find("%d+")
	if not a then
		-- Return an empty assetId in the case of no id in input.
		return ""
	end
	
	local assetId = tonumber(decalOrImageAssetUri:sub(a, b))
	local st, result = pcall(InsertService.LoadAsset, InsertService, assetId)
	if st then
		local decal = result:FindFirstChildWhichIsA("Decal", true)
		if decal then
			-- Note: Do not directly parent the found Decal to avoid
			-- security issues if untrusted Instances somehow ended up
			-- underneath it. Instead, extract the id.
			return decal.Texture
		end
	end
	
	return `rbxassetid://{assetId}`	
end

Courtesy of tnavarts

Try pasting the image in an ImageLabel, see if it load and if it does copy the Image (Id) and paste it in your code.