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```