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

How could you access a model or audio's name through the object's id on roblox?

Asked by 9 years ago

How could you access a model or audio's name through the object's id on roblox?

do i need httpservice?

2 answers

Log in to vote
6
Answered by 9 years ago

You would use the MarketplaceService.

Example code:

local Market=game:GetService("MarketplaceService")

function GetAssetName(AssetID)
    local ProductInfo=Market:GetProductInfo(AssetID,0)
    return ProductInfo.Name
end
0
This works only if you are going to buy the model or audio. If you want to held out the audio this is the way to go. If you want to inport it into your game like a map system use mine. LostPast 253 — 9y
2
@SporkyZ He's asking to get the name of the asset on the website, not the name of the content held within. Dakota99 90 — 9y
Ad
Log in to vote
0
Answered by
sad_eyez 162
8 years ago

mine is kind of the way Dakota99 did his, but with less coding, it's easier to make it a variable like this:

local name = game:GetService("MarketplaceService"):GetProductInfo(ID HERE, 0).Name

Answer this question