Whenever I use this script it changes the value of the lights color to some random number, not the numbers I have set, why is this?
1 | for _, light in pairs (game.Workspace:GetDescendants()) do |
2 | local surfaceLight = light:FindFirstChild( "AdministrationLight" ) |
3 | if surfaceLight then |
4 | surfaceLight.Color = Color 3. new( 255 , 255 , 255 ) |
5 | end |
6 | end |
You are using Color3.new() It is now required to use Color3.fromRGB() when doing RGB stuff.
Use this code:
1 | for _, light in pairs (game.Workspace:GetDescendants()) do |
2 | local surfaceLight = light:FindFirstChild( "AdministrationLight" ) |
3 | if surfaceLight then |
4 | surfaceLight.Color = Color 3. fromRGB( 255 , 255 , 255 ) |
5 | end |
6 | end |
If you have any questions feel free to ask.