Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

do you use BrickColor = BrickColor.new("Color") for a pointlight?

Asked by
Prioxis 673 Moderation Voter
10 years ago

I'm just now using a script that will change the color of a dynamic light but i'm not sure if i'm what I use to change the color value

2 answers

Log in to vote
0
Answered by 10 years ago

No, you would use something like this:

local light=script.Parent
light.Color=Color3.new(number,number,number)
0
You can also do BrickColor.new'Brick color'.Color if you really want authentic brick color color3. Bebee2 195 — 10y
Ad
Log in to vote
0
Answered by
m0rgoth 75
10 years ago

Every BrickColor variable has a Color property. See all of the properties and methods of BrickColors here. This property is the Color3 value equivalent of the BrickColor. So if you wanted to use a BrickColor for a Color3 field, you would do this:

local pointLight = workspace.light

pointLight.Color = BrickColor.new("Bright yellow").Color

If you wanted to know how to make a Color3 value, which is what is generally accepted by these fields, you would use this:

local pointLight = workspace.light

pointLight.Color = Color3.new(redValue,greenValue,blueValue)

Note that the Color3 values must be numbers between 0 and 1. Since it is more common to think of RGB values as numbers from 0 - 255, you can do something like this:

local function newColor(r,g,b)
    return Color3.new(r/255,g/255,b/255)
end

local pointLight = workspace.light

pointLight.Color = newColor(255,0,124)

Answer this question