--/ Variables
local MusicTopBar = script.Parent.MusicTopBar
local Progress = MusicTopBar.Progress
local Bar = Progress.Bar
local SongName = MusicTopBar.SongName
local SongUploader = MusicTopBar.SongUploader

local SongNameText = "Song: "
local SongUploaderText = "Uploaded By: "

local MarketplaceService = game:GetService("MarketplaceService")

local SoundService = game:GetService("SoundService")
local Music = SoundService:WaitForChild("Music")

local MusicInfo = {
	MusicName = "",
	MusicUploader = "",
}

--/ Functions
function SetGuiText()
	SongName.Text = SongNameText..MusicInfo.MusicName
	SongUploader.Text = SongUploaderText..MusicInfo.MusicUploader
end

Music.Changed:Connect(function()
	if Music.SoundId ~= nil and Music.Playing then
		local Info = MarketplaceService:GetProductInfo(string.sub(Music.SoundId,13,30),Enum.InfoType.Product)
		MusicInfo.MusicName = Info.Name
		MusicInfo.MusicUploader = Info.Creator.Name
		SetGuiText()
	end

end)

Doesn't Print Any Errors

2 comments

0

You using a Script or LocalScript?

0

On line 29, try changing Enum.InfoType.Product to Enum.InfoType.Asset, or just leave the second parameter blank since it defaults to it. I think Product is for developer products while Asset is for...well, assets.