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

GamePass Icons via Script Not Appearing, what am I doing wrong?

Asked by 2 years ago

Now, this has been asked many times but I am trying to make a shop UI that displays the icon of a gamepass. Now, I am actually using MarketplaceService, and all of it is working beside the icon.

Basically, I have a ModuleScript with a bunch of gamepass IDs to make it easier to swap out gamepasses in this menu. All of it works, including the names and purchasing of the gamepasses. The purchasing is built into the template that is being cloned.

local Settings = require(game.ReplicatedStorage:WaitForChild("MenuSettings"))
local mps = game:GetService("MarketplaceService")

for i, v in pairs(Settings.ShopPasses) do
    print(v)
    local info = mps:GetProductInfo(v,2)
    local NewFrame = script.Parent.Template:Clone()
    NewFrame.Parent = script.Parent
    NewFrame.Visible = true
    NewFrame.PassName.Text = info.Name
    print("rbxassetid://"..info.IconImageAssetId)
    NewFrame.ImageLabel.Image = ("rbxasset://"..info.IconImageAssetId)
    NewFrame.PassId.Value = v
end

The icon is just turning invisible. I put the print in there to get the ID, and after putting it into the ImageLabel, it works fine. It is only through the script that it breaks. Is there anything I am missing?

Answer this question