How do I silence every sound? I have this thing where when you go to space, but I want it realistic so I want all sounds to be silent when you reach space. Is this possible?
✓ ANSWER ACCEPTED
How do I silence every sound?
1 answer
✓ Accepted answer
Yeah. Here's some code that could mute all sounds:
function Mute(x)
if x:IsA("Sound") then
x.Volume = 0
end
for _,v in pairs(x:GetChildren()) do
Mute(v)
end
end
Mute(game)
Running this code on a Script would mute it for all players. Running this code on a LocalScript would mute it for the Local Player.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Recursive functions are no longer needed. Use :GetDescendents()
Thanks for replying to a 10 month old answer.