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

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

Asked by 5 years ago
Edited 5 years ago
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

Log in to vote
1
Answered by 5 years ago

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)
0
Obviously if everyone can hear the sound - you'll need to mute it from the server instead. SummerEquinox 643 — 5y
0
^ Muting sounds like something you'd do locally, I don't know why you would mute it for everyone User#22604 1 — 5y
0
^ Fair enough - just thought I'd throw that in there since I forgot it in my initial post. Thank you though. :) SummerEquinox 643 — 5y
Ad

Answer this question