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

How do I change a brick color and a SurfaceLight at the same time?

Asked by 5 years ago

In the beginning, I've tried doing...

script.Parent.MouseButton1Click:connect(function()
    local p = game.Workspace.OutlineLED:GetChildren()

    for i = 1,#p do

        p[i].BrickColor = BrickColor.new("Teal")
        game.Workspace.CrowdLight.SurfaceLight.Color = Color3.new("0, 255, 255")
        print("Light Is Now Cyan")
    end
end)

It just made the light black so I did

script.Parent.MouseButton1Click:connect(function()
    local p = game.Workspace.OutlineLED:GetChildren()

    for i = 1,#p do

        p[i].BrickColor = BrickColor.new("Teal")
        game.Workspace.CrowdLight.SurfaceLight.Color = Color3.new(Color3("0, 255, 255"))
        print("Light Is Now Cyan")
    end
end)

It just gave me an error saying Workspace.OutlineLights.SurfaceGui.ScrollingFrame.Cyan.Script:7: attempt to call global 'Color3' (a table value) I'm now in confusion like the lady that got confused with kansas and arkansas

0
Why don't you just make the material neon and change the brickcolor to green? Much easier than color3 values. cmgtotalyawesome 1418 — 5y
0
The color and material isn't the problem. it's the light by itself. The SurfaceLight.Color, It just changes to black or just gives me an error AwesomeGamer2223 105 — 5y
0
try doing game.Workspace.Yourpart.Brickcolor = Brickcolor "Teal" AnotherPerson_999 28 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

for one, you made a huge mistake with Color3 i once made, Color3.new() uses values BETWEEN 0 AND 1, not 0 and 255, if you want to use values between 0 and 255, use Color3.fromRGB() also, BrickColor values have a value called Color, it returns a color3 value that is the equivalent to its BrickColor counterpart,

local Color3Version = BrickColor.new("Teal").Color
0
Thanks! Used Color3.fromRGB(), VERY late accept since I forgot about this website, sorry about that lol. AwesomeGamer2223 105 — 2y
Ad

Answer this question