SurfaceGUI Prompt Gamepass Purchase not working

Hey! So I am trying to script a SurfaceGUI for my game, and it seems to not be working for an odd reason. Here is the script:

wait(1)
local MarketplaceService = game:GetService(“MarketplaceService”)
local info = MarketplaceService:GetProductInfo(script.Parent.Button.SurfaceGui.TextButton.GamepassId.Value,Enum.InfoType.GamePass).IconImageAssetId
script.Parent.Image.SurfaceGui.ImageLabel.Image = “rbxassetid://”…info

Anyone know why? If so please help me.

1 Like

Do you have 3rd party sales on?

Yea, 3rd party sales are turned on.

Can you show us your explorer?

1 Like

So change IconImageAssetId to the image id?

1 Like

What do you mean ? like the explorer in studio?

Yes, it would help for us for you to take a screenshot of your explorer.

Before we can give you a clear answer, there is some more info that we need.


1.) Is this inside a Script or a LocalScript?
2.) What is the hierarchy of the script, hence, what does your explorer look like? What is the script parented under, and what all is involved within the hierarchy?


Once you answer these questions, then, you will be able to get some help.

2 Likes

it is a script and image is the exploerer!

thanks!!! image theres the exploerer.

1 Like

I see it now! The :GetProductInfo() function returns a dictionary. So doing (“rbxassetid” … info) would not work. Instead of info there, you would do info. IconImageAssetId

1 Like