local main = script.Parent:WaitForChild("Main")
local sound = script.Parent:WaitForChild("Sound")
local songs = {427708534,4562607779,2808231858,296686470,454187551,633495936,469876597,896788607,1324725994,657284150}
local progress = main:FindFirstChild("ProgressBar").Progress
local songName = main:FindFirstChild("SongName")
while wait() do
sound:Stop()
progress.Size = UDim2.new(0,0,1,0)
if not sound.IsPlaying then
local songChosen = songs[math.random(1,#songs)]
local asset = game.MarketplaceService:GetProductInfo(songChosen)
sound.SoundId = "rbxassetid://".. songChosen
sound:Play()
songName.Text = asset.Name
wait(1)
progress:TweenSize(UDim2.new(1,0,1,0),'Out','Linear',(sound.TimeLength)-1)
wait((sound.TimeLength)-1)
end
end
Here is my explorer: https://prnt.sc/rgism6
Here is the UI: https://prnt.sc/rgisq7
Just wanted to mention, when I test in studio it works fine.
