Okay so, I’ve made a music system that displays the name of the song etc, now I want it to show a bar to show the song progress. I’ve tried searching a few different websites and stuff on how to do this, and I’ve had no luck. Here’s the code so far:
local sound = game.Workspace.SongPlay
local progress = script.Parent.Main.ProgressBar.Progress
local songName = script.Parent.Main.SongName
local songs = {
5060369688,
4954877483,
1518997709,
867775492
}
while wait() do
sound:Stop()
progress.Size = UDim2.new(0.022, 0,1, 0)
if not sound.IsPlaying then
local chosenSong = songs[math.random(1,#songs)]
local asset = game.MarketplaceService:GetProductInfo(chosenSong)
local timee = sound.TimeLength
sound.SoundId = "rbxassetid://"..chosenSong
sound:Play()
songName.Text = "Playing ; "..asset.Name
wait(0.5)
progress:TweenSize(UDim2.new(1, 0,1, 0),"Out","Sine",timee)
wait(sound.TimeLength)
end
end
Any help will be greatly appreciated.