Help with Solo Mute script

I’m trying to add a script (Module Layer Solo/Mute) that avoids having the Mute and Solo buttons on at the same time.
But is not working

My script:

-- Get the Layer Bus
local layerBus = this.parent.parent:getBus()

-- Get the Mute and Solo parameters of the Layer Bus
local muteParam = layerBus:getParameter("Mute")
local soloParam = layerBus:getParameter("Solo")

-- Check the state of Mute parameter and adjust Solo parameter accordingly
if muteParam then
    soloParam:setValue(false)
else
    soloParam:setValue(true)
end

Program tree

Screen Shot 2023-08-05 at 15.15.07 PM
Thanks in advance for any help!

Hi @clAud9

What are you trying to achieve? The solo and mute parameters are exclusive when it comes to a single element like layer, zone, bus. They may appear both on if the parent is muted. Let’s say you solo a layer bus but its parent layer is muted. To solve this you need to unmute the layer. Trying to turn off mute for the bus won’t help as it is already off.

Are you using a mixer channel template or just some buttons?

A simple solution could be to add controls only for layers or only for busses but not both.

Yes sorry in the end I think It’s better to leave them the way they are. Thanks anyway for the help.