How would I make a brick color change on playbackloudness

I have this thing where I can make a group of parts change color of the brick I set go with the music, but I was never able to make it so the the brick color just goes through the colors which looks like rainbows just flashing, I was wondering if someone could help me with this issues and tell me what I’m doing wrong.

game:GetService(“RunService”).RenderStopped:connect(function()
for I, v in pairs(workspace.BlocksFolder:GetChildren())
v.Color = Color3.new((Playbackloudness/15)/255, (Playbackloudness/15)/175,0)
end
end)

If you want it to go through the colors of the rainbow, you might want to look into Color3.fromHSV. The first argument is what the hue or tint is, the second is how saturated it is, and the third is how light it is. (If that was unclear, you can find a better description on HSV here.) Something like this should go through the colors of the rainbow:

-- same loop stuff that you had before, just replace the one `v.Color` line
v.Color = Color3.fromHSV((Playbackloudness / 15) / 255, 1, 1)
3 Likes

Thank you for sharing this with me.