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

How about a SurfaceLight color that equals to brick color?

Working with some lighting for a friends game but I have continued to fail to have my lights match their brick color. The brick color pattern is there below. I tried to change it so the lights color would have the same pattern. Of course it didn't work ,_,

while true do
wait(0.5)
script.Parent.Color = BrickColor.new("Bright red")
wait(0.5)
script.Parent.Color = BrickColor.new("Bright orange")
wait(0.5)
script.Parent.Color = BrickColor.new("Bright yellow")
wait(0.5)
script.Parent.Color = BrickColor.new("Bright green")
wait(0.5)
script.Parent.Color = BrickColor.new("Bright blue")
wait(0.5)
script.Parent.Color = BrickColor.new("Bright violet")
end

2 answers

✓ Accepted answer

Hello, honoroll123!

You can use this script:

while wait(.1) do
	script.Parent.Color = script.Parent.Parent.Color -- sets light color to it's parent's color
end

don't forget to make the script a child of the light =D

Good Luck with your games!!

2 comments

0

...I feel dumb now

0

Don't feel dumb, you're a new scripter, not dumb

While Leamir's answer is valid and correct, it would be much more efficient to do

script.Parent.Parent:Changed:Connect(function(property)
	if property == "Color" then
		script.Parent.Color = script.Parent.Parent.Color
	end
end)

1 comment

0

Or even better yet, change both the light and brick's color at the same time

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