Trying to set an image via script

Pretty much I’m trying to set a custom ID for an image, and nothing I’ve tried is working, even though it used to…?

ImageLabel.Image = "https://www.roblox.com/asset/?id=607948062"

That’s pretty much my code and it’s not setting the image, I’ve used rbxassetid://ID aswell and it isn’t working. No errors or anything, it just isn’t working. I can’t seem to find anything else that works either.

2 Likes

Is that the full script? Is the Image Label set to invisible?

1 Like

That is the only portion that matters, all of the code above it and below it works, so it isn’t yielding anything, the ImageLabel is visible because I can only set it manually in the properties section.

This code should work just by itself

ImageLabel.Image = "https://www.roblox.com/asset/?id=607948062"

But the main thing I’m trying to do is concat a new ID on the end of it, which wont work, but I don’t expect it to if giving it the entire link wont work.

I just tested out with that Id and seems to be working fine, so the problem is likely with it not loading (Should print in output), or you have referenced the ImageLabel variable to something else or you’re trying to reference the image label in StarterGui and not PlayerGui, common mistakes most people do.

That is really all I can help here, as everything else seems good.

You tried setting it via script or in the properties tab? I’ve tried with multiple images and none of them have worked.

Through the script, if you don’t mind can you check if the variable you’re referencing is correct? Otherwise I really don’t see any problem.

One thing that always gets me is the ImageTransparency property. Could you check if it’s at 0?

1 Like

It’s at 0, yes.
@WaterJamesPlough
I decided to do a test script like this and it doesn’t appear either.


The ONLY way it’s appearing is if I set it directly from the properties menu.

1 Like

Try this link, I pasted your original link and it changed to this:
https://www.roblox.com/asset/?id=607948062

1 Like

I think I see the issue, in your script, the ID isn’t the same as the one you provided in your original post.
nevermind, it’s a test script, hold on

1 Like

Yeah, tried ur link as well and it had not worked either.

1 Like

Could you provide that ImageLabel with the script as the child in a .rbxm file?

Here you go. brokenimageiguess.rbxl (23.9 KB)

1 Like

Capture d’écran, le 2020-12-09 à 00.47.49

Strange, it loaded for me. How long are you waiting for that image to appear?

I’ve been in the game upwards of 2-3 minutes for it to load.

1 Like

Have you tried using ContentProvider?

local cp = game:GetService('ContentProvider')

cp:PreloadAsync({"https://www.roblox.com/asset/?id=607948062"})

script.Parent.Image = "https://www.roblox.com/asset/?id=607948062"

I got the crossroads image to load, but a custom image will not load whatsoever.

1 Like

What did you do for that image? Was it just luck?

I loaded back into the game and it loaded. :thinking:

1 Like

Its probably a problem with your Roblox studio not being able to load, or maybe your internet, maybe just try it in Roblox Player and ensure it.