How to make a flickering light that dims (or flickers) more/less the louder/quieter a sound plays?

When viewing the properties in the studio I’m pretty sure thats your client not the server. If you print in the console, it should be 0.

local RunService = game:GetService("RunService")

RunService.Heartbeat:Connect(function()
	script.Parent.Part.Size = Vector3.new(script.Parent.PlaybackLoudness, 1, 1)
end)

This test script I wrote (later adjusted for NotoriousProphecy) was definitely reactive when testing to the old Roblox OOF sound and I was using a server script

1 Like

Boom! This worked! Of course I could change the intensity anytime, but MrNobodym8 is right. You have to use a Local Script.

Here’s the preview:

https://gyazo.com/e965574cb7eda3ae62aa59492b33d43a

Here’s the script: (Local Script inside StarterPlayerScripts)

local Light = workspace.Office.Light.Bulb.SpotLight
local Sound = workspace.Office.Light.FlickeringLightSound

Sound.Looped = true
Sound:Play()

while wait(0.05) do
	local currentLoudness = Sound.PlaybackLoudness
	Light.Angle = Light.Angle - currentLoudness * 2
	Light.Parent.Transparency = Light.Parent.Transparency + currentLoudness / 10
	wait(0.05)
	Light.Angle = 180
	Light.Parent.Transparency = 0
end

It could look better, but this works at least!

1 Like

Oh that’s weird maybe my studio’s just buggy, well glad it got resolved