Trying to change the text of some text labels using information obtained from GetProductInfo but GUI is not updating

  1. What do you want to achieve?
    I made a “GUI playground” a few days ago to play around with GUIs and I tried to make a gamepass shop where the Title, Description, Price, and Icons all sync together.
  2. What is the issue? Include screenshots / videos if possible!
    The problem is that my GUI does not update with the information.

Before Testing:


(Ignore the error in the output)

After Testing:


As you can see, no errors are showing up in the output box but my GUIs aren’t updated either.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried everything I can possibly think of: making a function, creating events, etc.

Below is a screenshot of my Explorer in case that helps you solve my problem:

Below is the code used in the LocalScript under Gamepass1:

local event = game.ReplicatedStorage:WaitForChild("GUIchange")

event.OnClientEvent:Connect(function()
	

local info = game.ReplicatedStorage.GamepassInfo

script.Parent:FindFirstChild("Name").Text = info.ProductName.Value
script.Parent.Description.Text = info.Description.Value
script.Parent.Price.Text = info.PriceInRobux.Value
script.Parent.RobuxIcon.Image = info.IconImageAssetId.Value
if info.IsForSale.Value == false then
	script.Parent.Buy.BackgroundColor3 = Color3.fromRGB(153,153,153)
	script.Parent.Buy.Text = "OFFSALE"
end
	
end)

Below is the code inside the Script:

local raw = game:GetService("MarketplaceService"):GetProductInfo(21448902, Enum.InfoType.GamePass)
local info = script.Parent.GamepassInfo


raw.Name = info.ProductName.Value
raw.Description = info.Description.Value
raw.PriceInRobux = info.PriceInRobux.Value
raw.IsForSale = info.IsForSale.Value
raw.IconImageAssedId = info.IconImageAssetId.Value

local event = game.ReplicatedStorage:WaitForChild("GUIchange")

event:FireAllClients()

Thanks to anyone who can help me :hugs:

Edit: Added Before/After Testing screenshots.

2 Likes

It would be helpful if we could see the children of gamepassinfo

2 Likes

image
Description, ProductName, and IconImageAssetId are String Values
IsForSale is a Bool Value
PriceInRobux is a Number Value

Modified:

local raw = game:GetService("MarketplaceService"):GetProductInfo(21448902, Enum.InfoType.GamePass)
local ReplicatedStorage = game.ReplicatedStorage
local info = ReplicatedStorage.GamepassInfo


info.ProductName.Value = raw['ProductName']
info.Description.Value = raw['Description']
info.PriceInRobux.Value = raw['PriceInRobux']
info.IsForSale.Value = raw['IsForSale']
info.IconImageAssetId.Value = raw['IconImageAssetId']

local event = game.ReplicatedStorage:WaitForChild("GUIchange")

event:FireAllClients()

I modified your code test this out, This’ll work. You messed it up, So I decided to fix this issue. And also, put the Script from ReplicatedStorage to ServerScriptService. Script and LocalScript objects will not run if they are parented to ReplicatedStorage even if they are not Disabled .

2 Likes

Thanks for the help. I’ll see if this works.

I did what you suggested and I got an error in the output:

UI also did not update:

Am I doing something wrong? Sorry if this causes you inconvenience, I’m not very good at this :sweat:

That’s odd, Hold on. Let me redo it

Fixed it! I did something terrible on “ProductName”. Here is the new one:

local raw = game:GetService("MarketplaceService"):GetProductInfo(21448902, Enum.InfoType.GamePass)
local ReplicatedStorage = game.ReplicatedStorage
local info = ReplicatedStorage.GamepassInfo


info.ProductName.Value = raw['Name']
info.Description.Value = raw['Description']
info.PriceInRobux.Value = raw['PriceInRobux']
info.IsForSale.Value = raw['IsForSale']
info.IconImageAssetId.Value = raw['IconImageAssetId']

local event = game.ReplicatedStorage:WaitForChild("GUIchange")

event:FireAllClients()

This should work.

1 Like

I’ll see if this works. Thanks for your time :pray:

2 Likes

It works now:

Thank you so much @Opinality! Have a nice day/night wherever you are! Stay Safe! :v:

1 Like