Having issue with SoundService:PlayLocalSound

  1. What do you want to achieve? Keep it simple and clear!
    I want a sound to play locally for a player in very fast succession.

  2. What is the issue?
    While using a while true loop the sound will play very fast jut fine like I want it to but when I want it to be played after a GetPropertyChangedSignal event fire it might only play once or twice.

The numbers in the console pop up when the sound should be played

  1. What solutions have you tried so far?
    I tried creating a new instance of the sound, playing, and destroying it but it does the same thing as SoundService:PlayLocalSound(tickSound) does.
local SoundService = game:GetService("SoundService")
local player = game.Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local ScrollBox = PlayerGui:WaitForChild("ScreenGui").MainFrame.ScrollBox
local tickSound = script.Sound
local lastFound = 0

--while wait() do
--	game:GetService("SoundService"):PlayLocalSound(tickSound)
--end

ScrollBox:GetPropertyChangedSignal("Position"):Connect(function()
	local boxPosition = ScrollBox.Position
	local truncatedPosition = math.floor(boxPosition.X.Scale*10)/10
	if truncatedPosition % .2 == 0 then
		if lastFound ~= truncatedPosition then
			print(truncatedPosition)
			lastFound = truncatedPosition
			SoundService:PlayLocalSound(tickSound)
		end
	end
end)

I guess you can make the sound’s loop property enabled and just increase its playback speed

No idea why this is happening. I would recommend using task.wait instead of wait since you don’t need the 2nd parameter.