I have a muting GUI that is supposed to mute ALL music in the Workspace if it’s playing. Here’s the code.
local child = game.Workspace:GetChildren()
if child:IsA("Sound") and child.IsPlaying == true then child.Volume = 0
end
end)
I need help as soon as possible.
1 Like
popeeyy
(pop)
November 4, 2019, 1:37am
3
This is because you’re trying to preform :IsA on a table not an object. You could sort through the objects in Workspace.
for _,child in pairs (game.Workspace:GetChildren()) do --Loop through everything in workspace
if child:IsA("Sound") and child.IsPlaying then
child.Volume = 0
end
end
1 Like
popeeyy
(pop)
November 4, 2019, 1:44am
5
I removed the end) at the bottom of the script as it’s completely unrelated to the block of code sent. You may want to add that back.
1 Like
You want me to add end) back at the bottom of the script, or you want me to add ) back?
1 Like
popeeyy
(pop)
November 4, 2019, 1:46am
7
Add an end back at the bottom.
Okay, now I want this to mute music on boombox gears. How would I do that?
1 Like
popeeyy
(pop)
November 4, 2019, 1:50am
9
If you would like to disable EVERY sound inside of the game in Workspace, you can replace GetChildren with GetDescendants.
That’s just a local only thing, so yeah.