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

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

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

3 comments

0

Why don't you just make the material neon and change the brickcolor to green? Much easier than color3 values.

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

0

try doing game.Workspace.Yourpart.Brickcolor = Brickcolor "Teal"

1 answer

✓ Accepted answer

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

1 comment

0

Thanks! Used Color3.fromRGB(), VERY late accept since I forgot about this website, sorry about that lol.

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