Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I silence every sound?

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?

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.

2 comments

0

Recursive functions are no longer needed. Use :GetDescendents()

0

Thanks for replying to a 10 month old answer.

This discussion is preserved as it was. New answers, comments, and votes are closed.