local main = script.Parent:WaitForChild("Main")
local sound = script.Parent:WaitForChild("Sound")
local songs = {725061858,569556642,327081386,669936570,970219205}
local progress = main:FindFirstChild("progress").bar
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

After the variables, the progress bar is supposed to move in sync with how much time in the song there is left. No idea why it isn't working.

1 comment

0

seems to work for me. could it be your connection to roblox is slow?. Just tried the script on my end and it plays the song(s) and the progress bar fills up.