I have a sound regions music style, and I'm trying to use a mute button in the bottom right of the screen to mute the music if you want to.
local hubmusic = game.StarterGui.SoundRegions.hubmusic
local off = false
script.Parent.MouseButton1Click:Connect(function()
print("music function connected")
if off == false then
off = true
hubmusic.Volume = ("0")
print(hubmusic.Volume)
elseif off == true then
off = false
hubmusic.Volume = ("0.5")
print(hubmusic.Volume)
end
end)
What's weird is that it successfully changes the volume of the music because it tell it to print its value, but in the game, the volume was not changed at all.

1 comment
I believe it is because you're attempting to set the music's volume to a string and not a number? Instead of ("0"), just put 0.