left = false

light1 = workspace.DiscoLight1
light2 = workspace.DiscoLight2

while true do
	local amplitude = (workspace.Speakers.Center.sieak.Sound.PlaybackLoudness + workspace.Speakers.Sub.soeak.Sound.PlaybackLoudness)/2
	print(amplitude)
	wait(0.05)
	if left then
		left = false
		light1.Pan.Tilt.Light.SpotLight.Brightness = amplitude/math.random(80,30)
	else 
		left = true
		light2.Pan.Tilt.Light.SpotLight.Brightness = amplitude/math.random(80,30)
	end
end

what this code is suppose to do is change the brightness of the lights depending on the loudness of the speakers.

1 comment

0

The number you end up with is probably too small for you to notice a difference.