Most efficient way to turn on and off many stationary lights at once?

Opps sorry, I missed the C++ label so what I wrote was meant for Blueprints. I don’t know how the base idea applies to C++.