Hello! Today im coding the SurfaceAmbience local script, what this script do? If you enter in some region it turning on ambience sound, if you leave, it turning off. But i got issue with ‘for i,v in pairs() do’ function. Basically he is skipping this function without any error.
Local Script: (Location: Game.StarterGui)
local soundManager = {}
for _, region in pairs(workspace.BRICKS.AreasRegions:GetChildren()) do --this function he skipping
local info = {}
local region3 = Region3.new(region.Position-(region.Size/2),region.Position+(region.Size/2))
info.Region = region3
info.Sound = script.Sounds:FindFirstChild(region.Name)
info.VolumeOfSound = info.Sound.Volume
table.insert(soundManager,info)
print("Done")
end
print("Setting set up!")
task.wait(10)
game:GetService("RunService").RenderStepped:Connect(function()
print("STEPPED RUNNING")
for i, soundInfo in pairs(soundManager) do
print("FOR I DO RUNNING")
end
end)

I tried to fix this but it still skipping this. Also i noticed if i disable local script and enable it again, this function won’t skip. What should i do to fix this?
