I just need to know if I can get ALL the lights instead of one by one on that for loop?
Overall, what I want to do is for the script to choose a random color from the color values I have in a folder in the same parent as script and get ALL the lights to have that same color. This script works but all the parts get different colors.
-- Sodaghost13
local light = script.Parent:GetChildren()
local colorsfolder = script.Parent.ColorsFolder:GetChildren()
for i = 1, #light do
if light[i].Name == "Light" then
local ChosenColor = colorsfolder[math.random(1, #colorsfolder)]
GetColor = ChosenColor.Value
light[i].Color = GetColor
end
end

2 comments
Just move line 8 outside of the for loop, before the loop.
That seems like the perfect code I don't see nothing wrong!