Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

No, you would use something like this:

local light=script.Parent
light.Color=Color3.new(number,number,number)

1 comment

0

You can also do BrickColor.new'Brick color'.Color if you really want authentic brick color color3.

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.