MainColor.BackgroundColor3 = Color3.new(math.random(255),math.random(255),math.random(255)) print(MainColor.BackgroundColor3)
The Output and The BackgroundColor3 have way different Values. WHY? D:
MainColor.BackgroundColor3 = Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255)
Color3 values are from 0 to 1. so to fix this, we will divide each one by a common denominator to make it over 1. This denominator will be 255, since 255 is the maximum Color3.
The main reason is because you're setting the colour to white (which is the color 255)
The thing you wanna do is
r = math.random(225) g= math.random(225) b= math.random(225) script.Parent.BackgroundColor3=Color3.new(r/255,g/255,b/255)
You didn't divide!
When you start a server, rgb values become a value from 0-1, they keep it at 255 while editing so you can get more exact. You need to* divide* the value by 255 to then put it into 0-1 form
MainColor.BackgroundColor3 = Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255)