Decal Image Delays

So, I have this bug in my ui where an image doesn’t load but for another image it works.



The assets work perfectly when I just paste the asset id on the properties in roblox studio, but when it is on a script, the images don’t load.
I checked my upload limit but there are no warnings or alerts about it. The decal still works when pasted on imagebuttons etc without scripting it.

The image above are the codes that DON’T LOAD the images, it only works for one rarity: common the one I showed in the first picture earlier.

This is likely because your not following the format of rbxassetid://[ID] which is used for assets like images.

Heres what it should be:


local shop : Instance
local rareprice : String
local epicprice : String
local legendaryprice : String
local mythicprice : String

local function ChangeMenu(Price, Class, Image1, Image2, Image3, Image4, Image5)

    shop:WaitForChild("Price").PriceCost.Text = Price
    shop:WaitForChild("Rarity").RarityClass.Cost.Text = Class
    shop:WaitForChild("Weapon1").Image = Image1
    shop:WaitForChild("Weapon2").Image = Image2
    shop:WaitForChild("Weapon3").Image = Image3
    shop:WaitForChild("Weapon4").Image = Image4
    shop:WaitForChild("Weapon5").Image = Image5

end

shop:WaitForChild("MythicCrate").Activated:Connect(function()
    ChangeMenu(mythicprice, "Mythic", "rbxassetid://15815483277", "rbxassetid://15815483277", "rbxassetid://15815483277", "rbxassetid://15815483277", "rbxassetid://15815483277")
end)

shop:WaitForChild("LegendaryCrate").Activated:Connect(function()
    ChangeMenu(legendaryprice, "Legendary", "rbxassetid://15815517912", "rbxassetid://15815517912", "rbxassetid://15815517912", "rbxassetid://15815517912", "rbxassetid://15815517912")
end)

shop:WaitForChild("EpicCrate").Activated:Connect(function()
    ChangeMenu(epicprice, "Epic", "rbxassetid://15815524799", "rbxassetid://15815524799", "rbxassetid://15815524799", "rbxassetid://15815524799", "rbxassetid://15815524799")
end)

shop:WaitForChild("RareCrate").Activated:Connect(function()
    ChangeMenu(rareprice, "Rare", "rbxassetid://15815360787", "rbxassetid://15815360787", "rbxassetid://15815360787", "rbxassetid://15815360787", "rbxassetid://15815360787")
end)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.