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 MusicInfo = {
MusicName = "",
MusicUploader = "",
}
--/ Functions
function SetGuiText(N,U)
SongName.Text = SongNameText..N
SongUploader.Text = SongUploaderText..U
end
function getId()
if string.sub(Music.SoundId,1,31) == "http://www.roblox.com/asset/?id=" then
return string.sub(Music.SoundId,31,string.len(Music.SoundId))
elseif string.sub(Music.SoundId,1,13) == "rbxassetid://" then
return string.sub(Music.SoundId,13,string.len(Music.SoundId))
elseif tonumber(Music.SoundId) then
return Music.SoundId
end
end
Music.Changed:Connect(function()
if Music.Playing ~= false then
local Id = getId()
local Info = MarketplaceService:GetProductInfo(Id)
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)
Error:
17:09:27.095 - Unable to cast string to int64 17:09:27.097 - Stack Begin 17:09:27.098 - Script 'Players.Professional_Lua.PlayerGui.Main.Main', Line 40 17:09:27.098 - Stack End
