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

change light colour to the same colour as a brick colour?

i asked a question a little while ago, i got an answer that worked but i didn't get a chance to expand on it, basically i got neon lights (Parts with neon texture) with point lights inside them. i was wondering how i could rearrange this script so the colour of the light matches the brick colour every time it changes. (If that makes any sense)

script:

math.randomseed(tick())
PartsToTurnColor = game.Workspace.CULUR:GetChildren()want to change color here
Colors = {BrickColor.new("Royal purple"),BrickColor.new("Steel blue"),BrickColor.new("Pastel blue-green"),BrickColor.new("Hot pink"),BrickColor.new("Bright bluish green")}

while wait(130) do
    color = Colors[math.random(1,#Colors)]
    for _,v in pairs(PartsToTurnColor) do
        v.BrickColor = color
    end
end

2 answers

✓ Accepted answer

if you change the brick color of a part then the rgb value will change as well, just grab the Color3 value and put it inside the lights Color3 Value

math.randomseed(tick())
PartsToTurnColor = game.Workspace.CULUR:GetChildren()want to change color here
Colors = {BrickColor.new("Royal purple"),BrickColor.new("Steel blue"),BrickColor.new("Pastel blue-green"),BrickColor.new("Hot pink"),BrickColor.new("Bright bluish green")}

while wait(130) do
    color = Colors[math.random(1,#Colors)]
    for _,v in pairs(PartsToTurnColor) do
        v.BrickColor = color
	pointlight.Color = v.Color
    end
end

4 comments

0

I think the asker should use color3 value instead. Because it will be more convenient. :-D

0

maybe the asker likes the preset colors

0

i used brickcolor instead of color3 because it kept turning the parts different colours

0

thanks dude ^^^^

Solve

You have to translate the brick colors to the RGB colors.

(Think)

I prefer to use color3 instead, because it will be more convenient.

BrickColor = {etc.}
......
Local color = Colors[math.random(1,#Colors)]
Brick.BrickColor = color
Local RGB = Brick.Color3

This is just an idea. Not a SCRIPT!

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