BoolValue not changing

This code is made so that volume can be turned on and off. For some reason however the script is refusing to change the bool from “true” to “false”.

local Sounds = workspace:WaitForChild("Sounds")

local Button = script.Parent
local Music = Button:WaitForChild("Active")

	if Music.Value == false then
		Music.Value = true
		Button.Image = 'rbxassetid://15998197117'
	if Music.Value == true then
		Music.Value = false
		Button.Image = 'rbxassetid://15998200046'

This is on a local script.

Any help would be greatly appreciated!

It could be because it checks the first “If” statement and toggles it on, then checks the second one and toggles it back off. Use “else” to see if it works.


Thanks for help lol. I’m so dumb. :laughing:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.