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

Getting the name of an ID from an object then pasting it on a gui?

Asked by
Belvari 15
7 years ago
Edited 7 years ago

Here's what I'm trying to accomplish.

I want to make a script that fetches the SoundID from a Sound that I've placed in the Workspace.

https://gyazo.com/c0ae957336a4b5726e5a2816aa507e28

The id is always changing as audio's shuffle!

So I need to make the script to where it fetches that id then, I want to use the market place service to get the name of that ID.

Example

local Asset = game:GetService("MarketplaceService"):GetProductInfo(THE ID)

then just print the name of the id on a screen gui

)
print(Asset.Name .. game.StarterGui.ScreenGui.Frame.Textlabel.Text

2 answers

Log in to vote
1
Answered by 7 years ago
Edited 7 years ago

You need to use MarketPlaceService I would use variables so here is my example code:

while true do
    id = script.Parent.TrelloSound.SoundId
    wait(0.01)
end

local name = game:GetService("MarketplaceService"):GetProductInfo(id)
text = name.Name
script.Parent.Text = text
Ad
Log in to vote
0
Answered by
Belvari 15
7 years ago
local Asset = game:GetService("MarketplaceService"):GetProductInfo(workspace TrelloSound.SoundID)
print(Asset.Name game.StarterGui.ScreenGui.Frame.TextLabel.Text )

Just tried this,

Answer this question