Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

How can I do this?

Asked by
Mephos 0
9 years ago

I cannot figure out how to mute the default players sound so you can hear other sounds. Is there a way you can mute the players sound?

0
Be more specific: what is the "players sound"? BlueTaslem 18071 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

All the sounds are in the character's head. Now lets use the PlayerAdded and CharacterAdded Service. You may look these up on the wiki.

game.Players.PlayerAdded:connect(function(player) --When a player joins
    player.CharacterAdded:connect(function(char) --Get the character
        local head = char.Head:GetChildren() --Get everything in the head, like sounds and faces.
        for _,sound in pairs(head) do --Get everything in the head
            if sound.ClassName == "Sound" then --If it's a sound, not the face or anything.
                sound:Destroy() --Get rid of sound.
            end --END
        end
    end)
end)

Hope this helps!

Ad

Answer this question