ISuperK
(ISuperK)
December 20, 2020, 1:15am
1
Does anyone know how I can do this
local music = game.Workspace.GameSongs.Sound
local music2 = game.Workspace.GameSongs.Sound2
script.Parent.MouseButton1Click:Connect(function()
if music.Volume == 0.5 then
music.Volume = 0
script.Parent.Parent.RoundMusic.BackgroundColor3 = Color3.new(0.666667, 0, 0)
else
music.Volume = 0.5
script.Parent.Parent.RoundMusic.BackgroundColor3 = Color3.new(0, 1, 0)
end
end)
Im trying to make it so that the 1 Button Mutes both sounds depending on which one is being played does anyone know a solution to this
lifacy
(lifacy)
December 20, 2020, 1:15am
2
You can have a variable for which one is currently playing and use that to mute it instead.
ISuperK
(ISuperK)
December 20, 2020, 1:17am
3
is it not possible to do this if music or music2.Volume == 0.5 then or is that not possible
lifacy
(lifacy)
December 20, 2020, 1:18am
4
You would need to do if music.Volume == 0.5 or music2.Volume == 0.5. However, I would not recommend this as having a variable that is set to the current song playing will be more scalabe in the future for adding more songs. You don’t want a pasta of if statements. Good luck
ISuperK
(ISuperK)
December 20, 2020, 1:19am
5
alright thanks ill try it out!!!