Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Could someone explain why the surfaceGUI won't update?

This simple, short little block of code is supposed to basically update a big screen to correctly show details about a specific place. I get no errors in my output, and the print() command works just fine, but the screen doesn't update at all.

Asset = game:GetService("MarketplaceService"):GetProductInfo(script.LookUpID.Value)
itemThumbnail = script.Parent.Frame.ScrollingFrame.ImageLabel.Image
itemDescription = script.Parent.Frame.ScrollingFrame.itemDesc.Text
itemName = script.Parent.Frame.ScrollingFrame.itemName.Text
itemLastUpdate = script.Parent.Frame.ScrollingFrame.updateDate.Text
itemType = script.Parent.Frame.ScrollingFrame.typeID.Text

function updateScreen()
	itemThumbnail = "http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=420&height=230&assetId="..script.LookUpID.Value
	itemDescription = Asset.Description
	itemName = Asset.Name
	itemLastUpdate = Asset.Updated
	print("Is it working?")
	print(Asset.Description)
end

game.Workspace.BUTTONBIG.ClickDetector.MouseClick:connect(updateScreen)

Edit: For due diligence I went ahead and added a new print() command to make sure that GetProductInfo() still works the way I thought it did, and that works, too.

2 comments

0

Do you have FilteringEnabled turned on? My guess is the client's actions aren't being sent to the server.

0

Filtering is disabled for this place.

1 answer

You set the Asset once in your script if you want to update your GUI you also need to update the Asset ;P

1 comment

0

While that actually is something I should probably fix, even if I set the asset in advance, it doesn't update.

This discussion is preserved as it was. New answers, comments, and votes are closed.