Alright so I have this script and i want the colourOn variable to be connected to a Color3Value so I can change the color through the Color3Value. Can someone help me? I know it needs to be divided by 255 on each value, But how would I do that?
colourOn = Color3.new(0, 0, 0) --Where the Color3Value should go colourOff = Color3.new(0, 0, 0) while true do c = script.Parent.LightUp:GetChildren() for i = 1, #c do if math.random() > 0.5 then c[i].Color = colourOn else c[i].Color = colourOff end end wait(0.2) end
Sorry if it's a little confusing, It's hard to explain.
You can divide it by 255 like this:
colourOn = Color3.new(0/255, 0/255, 0/255)
The 255 in rgb colors is the maximum amount colors everything uses. Having a number/255 just tells it how much of red, green or blue is in the color, so you can just find a rgb value and then in the script type
colourOn = Color3.new(r value here/255, g value here/255, b value here/255)
So having a value of 255/255, 0/255, 0/255 would be red
having a value of 0/255, 255/255, 0/255 would be green
having a value of 0/255, 0/255, 255/255 would be blue