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"
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"
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
tonumber( id:match("%d+$") )
nice one cabbler