Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does the image become blank?

Asked by
Bruvis 1
3 years ago
Edited 3 years ago

So I'm thinking of adding a card pack opening system and I've got everything working fine except changing the image anyone know what's wrong? It only becomes a blank image.

    local roll1 = math.random(1, 100)

    if roll1 <= 45 then
        card1.Image = "https://www.roblox.com/library/7220627763/Common"
    elseif roll1 > 45 and roll1 <= 80  then
        card1.Image = "https://www.roblox.com/library/7220628357/Rare"
    elseif roll1 > 80 and roll1 <= 99 then
        card1.Image = "https://www.roblox.com/library/7220629093/Epic"
    else roll1 = 100
        card1.Image = "https://www.roblox.com/library/7220629761/Legendary"
    end
0
I've found it out since this is an ImageLabel You need to make write out string.format("rbxthumb://type=Asset&id=%s&w=420&h=420", ID) Set the ID to any decal ID you'd like and it's auto insert it into the link. and it should change the image if you do                                                                                                           ImageDecal.Image. = string.format("rbxthum Bruvis 1 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

instead of using the full link https://www.roblox.com/library try just putting rbxassetid://ID_HERE

0
Thanks for the reply! When I tried your method it seems to have given me an error saying "Image https://assetdelivery.roblox.com/v1/asset?id=7220627763 failed to load. Error 403: Asset type does not match requested type" Any idea what the problem is? Bruvis 1 — 3y
Ad

Answer this question