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

Trying to make a Mute/Unmute Radio Button, Help?

local Player = game.Players.LocalPlayer
hidden = 1
function RunGui()
if hidden == 1 then 
	hidden = 2
	script.Parent.Text = "Unmute Radios"
	
	if Player:FindFirstChild("Shop") then
	Player.Game:Stop()
	end
	if Player:FindFirstChild("Shop") then
	Player.Shop:Stop()
	end
else
	hidden = 1
	script.Parent.Text = "Mute Radios"
	if Player:FindFirstChild("Game") then
	Player.Game:Play()
	end
end
end


Being a beginner, I've only made it this far, making the button GUI. I want to expand on this by giving it a purpose of muting "Radios" being played by other users. I'm working around a specific radio https://www.roblox.com/catalog/212641536/Golden-Super-Fly-Boombox this one to be exact.

1 answer

Use the Volume property to mute Sound objects.

You should have a clause such as this.

local Muted = false

TextButton/ImageButton.MouseButton1Click:Connect(function()
	if not Muted then
		Muted = true
		SoundObject.Volume = 0
	else
		Muted = false
		SoundObject.Volume = 1
	end
end)

3 comments

0

Obviously if everyone can hear the sound - you'll need to mute it from the server instead.

0

^ Muting sounds like something you'd do locally, I don't know why you would mute it for everyone

0

^ Fair enough - just thought I'd throw that in there since I forgot it in my initial post. Thank you though. :)

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