Hello!
I am creating a status effects system for my game, and I am using images for them.
Each one lasts 5 seconds and is the destroyed.
It all works fine, except the image itself doesn’t load when the item is cloned.
local frame = script:WaitForChild("EffectFrame")
local display = script.Parent:WaitForChild("Holder")
local powerIcons = {
[1] = "http://www.roblox.com/asset/?id=ID_HERE",
[2] = "http://www.roblox.com/asset/?id=ID_HERE",
[3] = "http://www.roblox.com/asset/?id=ID_HERE",
[4] = "http://www.roblox.com/asset/?id=ID_HERE",
[5] = "http://www.roblox.com/asset/?id=ID_HERE",
[6] = "http://www.roblox.com/asset/?id=ID_HERE",
[7] = "http://www.roblox.com/asset/?id=ID_HERE",
[8] = "http://www.roblox.com/asset/?id=ID_HERE",
[9] = "http://www.roblox.com/asset/?id=ID_HERE",
[10] = "http://www.roblox.com/asset/?id=ID_HERE",
[11] = "http://www.roblox.com/asset/?id=ID_HERE",
[12] = "http://www.roblox.com/asset/?id=ID_HERE"
}
local function addPowerEffect(power:string)
print("Received")
if powerIcons[power] then
local clonedFrame = frame:Clone()
local image = clonedFrame:WaitForChild("EffectImage")
clonedFrame.Parent = display
image.Image = powerIcons[power]
task.wait(3)
--code continues here, but it's irrelevant.
end
end
I’ve tried using rbxassetid://, just inputting the id itself, and using ContentProvider:PreloadAsync().
I was just wondering if anyone knew why the image won’t load when I use the script, but works just fine when I don’t.
When you upload images to roblox it could take a while for it to be accepted. I tried to upload a full white square and it got rejected . Maybe yours havent been accepted?
Enter the game, and in the explorer check the image labels properties. If the image id is empty than it is a problem with your scripts. If the image id is in the properties then it’s a problem with studio. Let me know what you see.
I’m quite unsure on what’s going wrong. The last thing I can think of maybe the transparency of the decals or maybe they are overlapping (ZIndex). I’m really sorry.
it might be already mentioned but when you paste the id in roblox studio it gets replaced with the image id instead of the decal which doesnt happen with scripts (I am pretty sure) and a ImageLabel wont accept a decal id it only accepts a raw image id of the decal
this is atleast what I know and this is the only way
to avoid confusion: a Image of the decal is made when you upload a decal which have different ids and different purposes!
edit: tried it and yes ImageLabels dont accept decal ids, and should be used with its own Image Id
edit2: can you mark this as a solution if it worked?
I already tried using rbxassetid://, http://www.roblox.com/asset/?id=, and just the id number. Didn’t realise decals and images have different IDs, I’ll give it a go since it’s an ImageLabel.