PlaybackLoudness in server sided script doesn't work?

I tried to make volume bar but loudness is always 0 even music is playing, what’s wrong?

local volbarOn = false
volbar.OnServerEvent:Connect(function(user)
	local volbarGui = nil
	if volbarOn == false then
		volbarOn = true
		if volbarGui == nil then
			volbarGui = script.volumeBar:Clone()
			volbarGui.Parent = nomGui
		end
		repeat
			if currentsong ~= nil then
				volbarGui.Text = currentsong.PlaybackLoudness
				volbarGui.Size = UDim2.new(0, volbarGui.Size.X, 0, (30 + currentsong.PlaybackLoudness / 0))
			end
			wait()
		until volbarOn == false
	else
		volbarOn = false
		volbarGui:Destroy()
	end
end)
3 Likes

PlaybackLoudness doesn’t update for the server, since if a sound is in a brick the clients will all have different distances and therefore volumes. You’ll need to run scripts that use it client sided.

1 Like