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

Could someone explain why the surfaceGUI won't update?

Asked by
chrono2 189
6 years ago
Edited 6 years ago

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.

0
Do you have FilteringEnabled turned on? My guess is the client's actions aren't being sent to the server. TheRings0fSaturn 28 — 6y
0
Filtering is disabled for this place. chrono2 189 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

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

0
While that actually is something I should probably fix, even if I set the asset in advance, it doesn't update. chrono2 189 — 6y
Ad

Answer this question