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

How to get the name of a song from id?

Any ideas to why this doesnt work?

local id = game.Workspace.Sound.SoundId
currentsong = game:GetService("MarketplaceService"):GetProductInfo(id).Name
print(currentsong)

"unable to cast string to int64"

1 answer

The problem is that Roblox can't convert your string to a number, because your sound ID is probably like "rbxassetid://"

You could use string.match() with the %d+ string pattern, get the substring, store the ID number in a script, or do something else.

2 comments

1

tonumber( id:match("%d+$") )

0

nice one cabbler

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