UPDATE: Solved, I did some network ownership changes to the speaker folder and all descendants, which appeared to fix it.
Hello, I’m currently in need of help!
I am building a BMS (Building Management System) and in the sound tab I have a bar that updates when the time position is changed.
However, when an audio is played, The TimePosition value never changes!
I’ve checked other posts on weather its a roblox patch or a normal behavior but I can’t seem to make any sense of it.
I can get the audio TimePosition in Client but not server.
Incase this is relivant, here’s the snippet of code that handles This system.
-- icui tracking time bar handler
local icuitrackingslider = nil
local S1,E1 = pcall(function()
icuitrackingslider = SLDR.New(ICUI.TIME,ICUI.TIME.BAR,ICUI.TIME.Interact,{
Range = {0, 0},
Increment = 0.1,
CurrentValue = 0,
Callback = function(Value)
ICUI.TIME.CURR_TIME.Text = FormatTimeString(tonumber(Value))
SPKRNET:Fire("setTimePos",{
["TIME"] = tonumber(Value),
})
end,})
end)
if E1 then warn("OKBMS :: ERROR WITH TRACKING SLIDER: ",tostring(E1)) end
local FRSTAUD:Sound = getFirstSpeaker():WaitForChild("SoundPart"):WaitForChild("Audio")
warn(FRSTAUD)
FRSTAUD:GetPropertyChangedSignal("SoundId"):Connect(function()
repeat task.wait() until firstAudioLoaded() == true
local TIMELENGTH = getCurrentMusicTimelength()
icuitrackingslider:SetLims(0,tonumber(TIMELENGTH))
end)
task.spawn(function()
game:GetService("RunService").Stepped:Connect(function()
local tpos = getCurrentMusicTimeposition()
warn("TIMECHANGE: ",tpos) --debug
ICUI.TIME.CURR_TIME.Text = FormatTimeString(tonumber(tpos))
icuitrackingslider:SetBar(tpos)
task.wait()
end)
end)
If you know what i am doing wrong, Please help me out!
Thanks!