You just need a slider going from -24 to 0 value wise (you can use a different range, I like that one which was used in the tutorial I followed). Then you connect the value_changed signal to a script running this code:
func _on_VolumeSlider_value_changed(value):
if value == -24:
AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), true)
else:
AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), false)
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), value)