If it’s a UMG slider we’re talking about, you can override its onValueChanged:
You may want to work in another an additional bool, and only turn the light on when it’s off and vice versa. The example above will work fine, though.