.TimePosition not changing on a sound that is playing on a GUI

.TimePosition does not change on a sound that is on a GUI, the localscript is there but it doesn’t work at all.

image

LocalScript:

I don’t know why does it not change.
I made it as a non-localscript but the same delay as the serversided one is the same.
Any help?

Probably due to client-server replication, reference the Sounds inside SoundService instead?

I’ve just tested it and the method you’re using works fine. Can you post the entire script to see what else may be causing the issue?

The TimePosition I set on a song has value of 2 on “WhichSecItStarts” But It doesn’t start at 2, It starts at 0.

It’s the part of the script that is not working.


local ui = script.Parent

local config = ui.Config

local events = ui.Events

local stage = ui.Stage.Value

local userinput = events.UserInput

local side = ui.PlayerSide.Value

local settings = require(stage.GameSettings)

side = ui.Game:FindFirstChild(side)

repeat wait() until stage.Config.Song.Value -- SONG CHOSEN HERE. Start up the game.

local song = stage.Config.Song.Value.Value

song = game.HttpService:JSONDecode(song).song

local bps, bpm = 60 / (song.bpm or 120), song.bpm

local songholder = stage.Config.Song.Value:FindFirstAncestorOfClass("StringValue") or stage.Config.Song.Value

local songholdera = stage.Config.Song.Value

script.Parent.Game.Playing.Text ="Playing: "..songholdera.Name

script.Parent.Game.Credits.Text = "By: "..stage.Songs[songholdera.Name].Credits.Value

script.Parent.SoundBar.Disabled = false

if songholder:FindFirstChild("Instrumental") then

game.SoundService.Inst.SoundId = songholder.Instrumental.Value

game.SoundService.Inst.PlaybackSpeed = songholder.Instrumental.PlaybackSpeed.Value

game.SoundService.Inst.Volume = songholder.Instrumental.Volume.Value

end

if songholder:FindFirstChild("Sound") then

game.SoundService.Vocals.SoundId = songholder.Sound.Value

game.SoundService.Vocals.PlaybackSpeed = songholder.Sound.PlaybackSpeed.Value

game.SoundService.Vocals.Volume = songholder.Sound.Volume.Value

end

spawn(function()

repeat wait() until stage.MusicPart["Go"].Played:Wait()

stage.MusicPart.Music.Volume = 0

stage.MusicPart.Vocals.Volume = 0

stage.MusicPart.Music.TimePosition = stage.Songs[songholder.Name].WhichSecItStarts.Value

stage.MusicPart.Vocals.TimePosition = stage.Songs[songholder.Name].WhichSecItStarts.Value

game.SoundService.Vocals:Play()

game.SoundService.Inst:Play()

game.SoundService.Inst.TimePosition = stage.Songs[songholder.Name].WhichSecItStarts.Value

game.SoundService.Vocals.TimePosition = stage.Songs[songholder.Name].WhichSecItStarts.Value

end)```

Those two lines of script work on a non-localscript, but the stage.Songs[songholder.Name].WhichSecItStarts.Value does not work on a localscript

I already tried with SoundService but didn’t work.