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

How Do I Fix It So That It Doesn't The Music Muter Also Mutes Other Plays? [closed]

Asked by
vh_ft -5
7 years ago
Edited 7 years ago

this is the script

the title says all

local muted = false

script.Parent.MouseButton1Click:Connect(function()
if muted == false then
    for i,player in pairs(game.Players:GetChildren()) do
            if player.Character.Head:FindFirstChild("Sound") ~= nil then
                if player ~= game.Players.LocalPlayer then
                    player.Character.Head:FindFirstChild("Sound").Volume = 0
                end
            end
        end
    muted = true
else
for i,player in pairs(game.Players:GetChildren()) do
            if player.Character.Head:FindFirstChild("Sound") ~= nil then
                if player ~= game.Players.LocalPlayer then
                    player.Character.Head:FindFirstChild("Sound").Volume = 25
                end
            end
        end
        muted = false
    end
end)

0
Is your place using filtering enabled? jbjgang2 37 — 7y

Closed as Non-Descriptive by hiimgoodpack, lukeb50, and abnotaddable

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
-1
Answered by 7 years ago
Edited 7 years ago

You could try modifying the script so it works for only one player (LocalPlayer) or doing something like putting it in a Local Script

Or

You could use Filtering Enabled

Ad