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

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

Asked by 5 years ago

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

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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
0
I think the asker should use color3 value instead. Because it will be more convenient. :-D DERP9487 41 — 5y
0
maybe the asker likes the preset colors EnderPowerHD 98 — 5y
0
i used brickcolor instead of color3 because it kept turning the parts different colours Bylli_Oruze 38 — 5y
0
thanks dude ^^^^ Bylli_Oruze 38 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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!

Answer this question