Hey Sphynks,
I was looking into your issue and the issue that you're having is but, a tiny one. The only thing that's happening is when you get the SoundId, it comes in a String, first off, you need to get the numbers from this String because, a SoundId comes in the following order:
rbxassetId://[ID]
###Well, you need to get the ID from that string and it's very simple to do that with a bit of string patterns and methods. You are going to use the :match() method of strings to accomplish this. Below is an example of how you'd do that. I'm going to use the id "rbxassetid://787837201" for this example.
####Example A
local id = "rbxassetid://787837201";
local real_id = id:match("%d+")
print(real_id)
###Alright, now that you've got the idea, you just need to put the real_id as the argument for :GetProductInfo, it should auto-matically cast the String into a Number then. Below is an example of this using your script.
####Example B
local gui = script.Parent;
local music = workspace.MusicPlayer.MusicScript.Sound;
local SoundId = music.SoundId
local real_id = SoundId:match("%d+")
local Asset = game:GetService("MarketplaceService"):GetProductInfo(real_id)
while wait() do
gui.Text = "Music name ="..Asset.Name.."/ ID ="..SoundId
end
###Also, I'm not sure as to why you are using a while loop but, you must have your reasoning for that.
##Well, I hope I helped and have a wonderful day/night.
~~ KingLoneCat
1 comment
Oh someone else got the same idea ^^