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

how do i get the name of the sound that's playing on a sound object?

so, i am working on this game for my friend, which has a lot to do with sounds.. i ran into a problem when i realized that i don't know to get the name of a song that's currently playing...

how do i do it?

thanks

1 answer

✓ Accepted answer

Okay, you can use MarketPlaceService for that.

And to get the audio id without the rbxasset:// you need to format it.

The script is:

local sound = game.Workspace.Sound --The sound
local assetId = sound.SoundId --Getting the original soundId
local soundId = assetId:match("%d+") --Taking away the rbxassetid://

local product = game:GetService("MarketplaceService"):GetProductInfo(soundId) --Getting the audio

print(product.Name) --The Sound Name

If you have any further questions, comment.

1 comment

0

thanks.. I need to start reading about roblox APIs.. But i am busy working on other things lol

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