I’m attempting to edit this script that I found via a youtube video so that it will control the enabled state of point lights. It currently uses PlaybackLoudness to change the color of a part.
I cannot seem to edit the script so that it 1, controls the point light in question, and 2, controls the enabled state of said light.
I’ve tried changing the BrickColor variable to Color3, as well as changing “TEST” and “P” to the titles of the part (“P” in this case) to PointLight, and “TEST” to the name of the part.
The current explorer, if this is of any assistance:
Hello @luvlorns! So after reviewing the code and messing around with it a bit, I believe I have come up with a viable solution. This code (see below) makes both the BrickColor and the PointLight’s Color change based off of the PlaybackLoudness.
game:GetService("RunService").RenderStepped:connect(function()
local loudness = game.workspace.Music.PlaybackLoudness
if loudness >= 200 then
game.workspace.TEST.P.BrickColor = BrickColor.new "Industrial white"
game.Workspace.TEST.P.PointLight.Color = Color3.new(1, 1, 1)
else
game.workspace.TEST.P.BrickColor = BrickColor.new "Really black"
game.Workspace.TEST.P.PointLight.Color = Color3.new(0, 0, 0)
end
end)
And here’s a picture of my current Explorer (see below).