I was trying to make a music player and thought of making a script that identifies an asset if it is valid, invalid, or not a sound ID, but it made me think "how can I find the results directly from the sound instance?" I researched and find no results. For now I haven't made a code. Does someone know an easy way to make a script which identifies asset id's presence and validity?
✓ ANSWER ACCEPTED
How can I make a script which knows if an asset is invalid or deleted?
1 answer
✓ Accepted answer
You could use MarketPlaceService:GetProductInfo() to find if the sound exists in the website library or not.
local mas = game:GetService('MarketplaceService')
local soundId = 0
local asset = mas:GetProductInfo(soundId)
if asset.Name ~= nil then
print('exists')
else
print("doesn't exist")
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
It works. Thanks!