So I'm trying to make a music playlist where the bar moves, and the time is displayed

so, what I’m trying to do is have a bar that moves as the song plays.

Another thing, I’ll provide a screenshot of my currentGUI

now in this screenshot in the right I want the “0:00” to slowly increase as the song plays, the text like how apple music has it but I want it to be for example “1:25”

the left, like apple music I want the song to display the TimeLength that’s like " - 1:35" meaning the song is 1 minute and 35 seconds long.

I want the “SONG NAME” to constantly change to the name I choose which you see in the script I provided u below, not what’s on roblox, I want to choose the song name for each song,

KEEP IN NOTE: I want all players to be in sync with the same song, if a player joins the game they hear what everyone hears in the game, the music is a server playlist, not a local player. I want everyone to hear the same song.

local currentTrack = game.ReplicatedStorage.CurrentTrack
local songsFolder = game.ReplicatedStorage.Songs
local container = sp.Frame.Container
local completeTimelineGui = container.Bar.Indicator
local duration = container.Duration
local durationtimer = container.DurationTimer

function updateTimeline(audio)
	while true do
		container.SongName.Text = currentTrack.Value
		if audio.IsPlaying then
			local progress2 = durationtimer.Text == audio.TimePosition / audio.TimeLength
			local progress = audio.TimePosition / audio.TimeLength
			completeTimelineGui.Size = UDim2.new(progress, 0, 1, 0)
		end
		wait(0.1) -- Adjust the update interval as needed
	end
end

local audio1 = songsFolder.S1
local audio2 = songsFolder.S2

-- Start updating the timeline in a separate thread
while true do
spawn(function()
	updateTimeline(audio1)
end)

songsFolder.S1:Play()
duration.Text = songsFolder.S1.TimeLength
currentTrack.Value = "test"
wait(30)
songsFolder.S1:Stop()

spawn(function()
	updateTimeline(audio2)
end)

songsFolder.S2:Play()
duration.Text = songsFolder.S2.TimeLength
currentTrack.Value = "test2"
wait(30)
songsFolder.S2:Stop()
end```
2 Likes

It’s being recognized that its like you’re trying to get free work rather than actual help with a scripting problem, so goodluck with getting help for this.

But for this there’s an array of better ways to do this.

  1. Listen to an event and wait for the server to tell you the the song name and length, which is changed in the UI locally.
  2. Track the Sound that’s playing throughout the server, and use the name and time position of that Sound instance to set your UI correctly.
  3. Same as 2 but have the server provide through event the audio instance which to be tracked for the UI.
1 Like

This is so stupid :skull: but I could try to help but idk

Great now the flags are getting through Yoo-hoo!

1 Like

Jet just joined now? Hello there!

dude you really need a life, like seriously you’re mad because I’ve defended myself? None of you offered help, all you did was argue? This forum was to help people, yet I don’t even get any help, can’t even provide a sample code or anything, why are you on this platform? Not to mention this dude didn’t even help, he just stated the obvious, listen to the server? Like, what? This dude doesn’t even know how to script or anything, he just stated the obvious

Tbh I’m not on devforum to argue I’m just on devforum to help and make chaos happen

Did you even see my title? I guess not

And you don’t even have a flair or title. So how do we know that this isn’t stolen code you’re using?