Game wont load images when inputted correctly?

Hey, so a weird issue here, my game isn’t loading images even though I’m putting the asset ID in correctly through my script.

Code:

Menu.MaterialShop.ShirtCustomization.DecalInput.FocusLost:Connect(function()
	if tonumber(Menu.MaterialShop.ShirtCustomization.DecalInput.Text) then
		local Id = "http://www.roblox.com/asset/?id="..Menu.MaterialShop.ShirtCustomization.DecalInput.Text
		Menu.MaterialShop.ShirtCustomization.SetImage.Image = Id
	else
		Menu.MaterialShop.ShirtCustomization.DecalInput.Text = "Input is not a number!"
	end
end)

I have also tried

local Id = "rbxassetid://"..Menu.MaterialShop.ShirtCustomization.DecalInput.Text

which also didn’t work.

Am I doing something wrong or is roblox being weird?

1 Like

when you set the id, does the image id get updated?

2 Likes

The issue in your code lies in how you are assigning the value to the Image property. In both cases you are assigning a string (the asset ID or URL) to the Image property, but the Image property expects an actual image asset or URL, not just a string, to fix that you need to use the ImageLabel 's Image property with a valid asset ID or a URL Xx

1 Like

It does, the image just never loads despite the ID being correct.

Also, when I insert the same ID directly into the UI through the explorer the image loads correctly.

2 Likes

Hmm, pretty odd, i think it might be something with the engine.

Try restarting studio

2 Likes

I’ve used this string method many times before, and its worked every previous time.

I even use the exact same method of using strings in this post:

2 Likes

Already have several times, still not working.
Why are every one of my games always broken in SOME way

2 Likes

Make sure that the asset ID you’re providing is correct and corresponds to a valid image asset in Roblox. If the image still doesn’t load, double check the asset ID or try using a different asset to see if it resolves the issue. If it doesn’t then I think it has something to do with the engine

2 Likes

I’ve made sure the ID is correct multiple times, tried using 4 different images and still not working.

All 4 images were uploaded to roblox for at least a month, too.

I am so confused.

2 Likes

Must be an engine bug then, i’m not really sure though

2 Likes

Well, I found something out.

Every ID has its own offset for some reason?

Say an image ID when copied is 123456, the ID in studio after loading will be 123449

2 Likes

I’ve never had an inaccurate ID before? Damn that’s intresting

2 Likes

It could be for a few reasons but I’m not certain, asset IDs are typically consistent and should not have offsets when loaded in the studio, so the presence of such offsets could be due to factors like cached data, versioning or variations, or script/plugin interference, and further investigation or assistance from Roblox support

2 Likes

Decided to clip the issue, and yeah its every single image having an offset.

(In case you missed it, the number I inputted ended with 40, and the number after loading ending in 68)

2 Likes