Hello! So, I want to set an ImageButton’s Image property through an image ID that I have. When I do it by hand, and enter the ID in the Image property, it seems to come out fine and looks something like this: http://www.roblox.com/asset/?id=MyIdThatIPut
The “http://www.roblox.com/asset/?id=” came automatically, all I entered was the actual ID, something like, 1234567. Now, when I do the same function through code:
local MyID = 1234567
ImageButton.Image = MyID-- Test ID
It actually sets the image ID to 1234567, instead of putting the placeholder of http://www.roblox.com/asset/?id=
So, trying another way, I decided to enter a string value, with a placeholder included, my code looks something like this now:
local MyID = 1234567
ImageButton.Image = "http://www.roblox.com/asset/?id="..MyID
Now, it’s giving me an error that the type of ID I put into the Image property, is not the correct type. Tonumber
does not work on that placeholder either as it’s not a number in any way. Does anyone know any solutions? Thanks!