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

How to make a pointlight change various colors?

Hi, im making a game were I need the pointlight in my brick to change colors. Not random colors, specific colors I want. (Red, orange, yellow, neon green, green, cyan, blue, magenta, purple.) I would like these to repeat forever. Not really fast though, I dont plan on my players getting seizures. Like the colors will cycle in a minute of so then the cycle repeats.

Please help me out with this!

THANKS!

~123bbz

1 comment

0

What i"m going to do with the script when I get it is paste it into a brick with a pre-existing pointlight. The script will keep the range and brightness of the pointlight the same but will merely change the color of the light. ~123bbz

2 answers

I see that you need one. What are you going to do to get it? If you need help scripting ask a question. Anything other than scripting questions post on the ROBLOX forum.

2 comments

0

Nice! I see that you have contributed well to my question! (SARCASM) What i"m going to do with the script when I get it is paste it into a brick with a pre-existing pointlight. The script will keep the range and brightness of the pointlight the same but will merely change the color of the light. ~123bbz

0

Okay I get that but first write us a script if you want help.

This may not be the most efficient, but it will do the job. It uses a for loop to "tween" the colors.

while true do
	for i=1, 60 do
		script.Parent.Color = Color3.new(1, i/60, 0)
		wait(.1)
	end
	for i=1, 60 do
		script.Parent.Color = Color3.new(1-(i/60), 1, 0)
		wait(.1)
	end
	for i=1, 60 do
		script.Parent.Color = Color3.new(0, 1, i/60)
		wait(.1)
	end
	for i=1, 60 do
		script.Parent.Color = Color3.new(0, 1-(i/60), 1)
		wait(.1)
	end
	for i=1, 60 do
		script.Parent.Color = Color3.new(i/60, 0, 1)
		wait(.1)
	end
	for i=1, 60 do
		script.Parent.Color = Color3.new(1, 0, 1-(i/60))
		wait(.1)
	end
end

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