-
What do you want to achieve?
I want to make mute button sound on and off using topbarplus -
What is the issue?
So basically whenever I click the topbarplus I did for the mute button is not muting the sound doesnt matter if I keep clicking on or off -
What solutions have you tried so far?
I have look for video tutorial nothing I have tried moving sound into workspace nothing
Now im on soundservice
local container = script.Parent
local Icon = require(container.Icon)
local SoundService = game:GetService("SoundService")
local music = SoundService:WaitForChild("BackgroundMusic")
local muteIcon = Icon.new()
:setName("MuteButton")
:setLabel("Mute / Unmute")
:setImage(16086868244, "Deselected")
:setImage(16086868447, "Selected")
local isMuted = false
-- Use the module's click function
muteIcon:OnClick(function()
isMuted = not isMuted
if isMuted then
music.Volume = 0
muteIcon:setState("Selected")
else
music.Volume = 1
muteIcon:setState("Deselected")
end
end)