Change color of light to be the same colour as Brick Colour

local color = script.Parent.BrickColor 
color = script.Parent.light.Color 

Basically, I want the color of the light to be the same as the colour of the brick.
Can somebody help me?

1 Like
local Light = --define the light
Light.Color = script.Parent.Color

BrickColor will not index with the light as it uses Color3. Use Part.Color instead.

Doesn’t work, also the light is a beam and not a light.

1 Like

Beams use ColorSequence.
You’ll need to set it to ColorSequence.new() instead.

And what would the script look like?

show the workspace of where light and the brick are.

local beam = --define it here
beam.Color = ColorSequence.new(script.Parent.Color)

[assuming you want a solid color and no gradient]

local beam = script.Parent.light

beam.Color = ColorSequence.new(script.Parent.Color)

Screenshot 2021-02-17 at 20.09.24
Would this be the correct place, since it isn’t working?

1 Like

What error output does that throw?

It doesn’t throw out any error output.

1 Like

Strange, I’m not sure why it isn’t changing, as it should be printing something if there’s incorrect input.
If it’s any help, I’ll link the ColorSequence API Reference for you.
ColorSequence (roblox.com)

just run this, this worked for me :

local Part = game.Workspace.BeamPart
local Beam = Part.Beam

Beam.Color = ColorSequence.new(Part.Color)

you could use Part = Script.Parent
if the workspace looks like this
image
before:
image
after:
image