Having an Issue muffling audio when at low hp

I’m having a problem with a certain line of code that doesn’t allow it the activate the key function in game.

while true do
if script.Parent.Humanoid.Health <= 35 then --] Health optional.
game.SoundService.EqualizerSoundEffect = true
else
game.SoundService.EqualizerSoundEffect = false
end
wait()
end

When I go in game it says `EqualizerSoundEffect is not a valid member of SoundService “SoundService”

Any way to fix this issue?

2 Likes

This mean that EqualizerSoundEffect is nil / not loaded yet while the loop is running
Check first if EqualizerSoundEffect exist using :WaitForChild() or if EqualizerSoundEffect ~= nil then

Ah, thank you this helps. I can now continue my progress.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.