Local Script:
--/ 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 Playing = false
local MusicInfo = {
MusicName = "",
MusicUploader = "",
}
--/ Functions
function SetGuiText(N,U)
SongName.Text = SongNameText..tostring(N)
SongUploader.Text = SongUploaderText..tostring(U)
end
function sub(String,Num1,Num2)
return string.sub(String,Num1,Num2)
end
function len(String)
return string.len(String)
end
function getId(Sound)
if sub(Sound.SoundId,1,13) == "rbxassetid://" then
if tonumber(sub(Sound.SoundId,13,len(Sound.SoundId))) then
return sub(Sound.SoundId,13,len(Sound.SoundId))
end
end
end
game.SoundService.Music.Played:Connect(function()
Playing = true
end)
Music.Changed:Connect(function()
if Music.IsPlaying == true then
local Id = getId(Music)
print(Id)
local Info = MarketplaceService:GetProductInfo(tonumber(Id),Enum.InfoType.Asset)
SetGuiText(Info.Name,Info.Creator.Name)
end
-- if Music.TimePosition > 0 then
-- Bar:TweenSize(UDim2.new(Music.TimePosition/Music.TimeLength,0,0,4),"Linear","Out",true,0.5)
-- end
end)
