if Object.LightObject.PointLight.Brightness == 0 then
Object.LightObject.PointLight.Brightness = 1
else
Object.LightObject.PointLight.Brightness = 0
end
Reason I don’t want to create a variable is because I’m not worried about organization and cleanliness. I just feel like there’s a much more efficient way to do this.
Out of curiosity: why does the Enabled property not work for you? Setting the Brightness to 0 is essentially the same as disabling the light unless you have a use case that requires it to be on while it’s not actually emitting any light?
You should be able to just set the Enabled property to the inverse of its current setting.
Object.LightObject.PointLight.Enabled = not Object.LightObject.PointLight.Enabled
Since Brightness = 0 and Enabled = false are the same and my script is about tweening (didn’t mention this, oops), I decided to kill two birds with one stone. Enabled = false wouldn’t have worked anyways just because of how my client and server effects modules handle things.