how do i create a sound off button?

Should this not work. i tried what you did but it made no difference.