So I'm trying to make a round based game with images for every single minigame. The issue is, when I try to set the image of the ImageLabel, it doesn't show!
Here's the script I tried:
local ids = { 397558836, 32348996, 477764158 } local chosen = math.random(1, #ids) script.Parent.Image = 'rbxassetid://'..tostring(ids[chosen])
The problem is that I'm not getting any error message. The Image just won't show. If I check the properties of the ImageLabel, it show that the image is 'rbxassetid://chosenid'.
I'm very confused...
The problem in here is that the IDs are not link to the images, they are links to the decals, therefore they do not load since you need the images.
To obtain the images, go to the id and subtract 1 from it (Example: 397558836 is actually 397558835)
I confirmed this worked for the first 2.
I am not a very experienced scripter. But from what I've seen. When you load whatever game that uses local images and image label. The usual "rbxassetid://" is converted to "gameasset://". Since you can not use "gameasset://" to load your images, just do the following.
local ids = { "rbxassetid://397558836", "rbxassetid://32348996", "rbxassetid://477764158" } local chosen = math.random(1, #ids) script.Parent.Image = ids[chosen]
When the game will start, it will convert the "rbxassetid://" to "gameasset://" and normally, will load the images.
I am not very good at explanation but I hope you understood.