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

Why do the lights turn blue?

I have a script made to make the lights flickering, but instead of turning the lights back to (248, 217, 109) (which is yellow) like the script says to, the lights turn to (8, 39, 147) (which is blue). My script is:

local light = script.Parent.Part.SpotLight
local light2 = script.Parent.Part2.SpotLight
local light3 = script.Parent.Part3.SpotLight
local value = script.Parent.Parent.Parent.PowerOutage.Value

while true do
	wait(math.random(0.5,3))
	if value == false then
			
		light.Brightness = 0
		light.Parent.Material = Enum.Material.Plastic
		light.Color = Color3.new(0, 0, 0)
		
		light2.Brightness = 0
		light2.Parent.Material = Enum.Material.Plastic
		light2.Parent.Color = Color3.new(0, 0, 0)
		
		light3.Brightness = 0
		light3.Parent.Material = Enum.Material.Plastic
		light3.Color = Color3.new(0, 0, 0)
		
		wait(math.random(0.8,1.3))
		
		light.Brightness = 1
		light.Parent.Material = Enum.Material.Neon
		light.Parent.Color = Color3.new(248, 217, 109)
		
		light2.Brightness = 1
		light2.Parent.Material = Enum.Material.Neon
		light2.Parent.Color = Color3.new(248, 217, 109)
		
		light3.Brightness = 1
		light3.Parent.Material = Enum.Material.Neon
		light3.Parent.Color = Color3.new(248, 217, 109)
		
	else
		
		wait(math.random(0.8,1.3))
		
	end
	
end

(The value and checking is for something I'm implementing later)

Here's a screenshot of the Explorer:

https://gyazo.com/502e506822a454e8f0c5ea0c14dd5ef1

1 answer

✓ Accepted answer

I think what you're looking for is Color3.fromRGB and not Color3.new()

here's how you change a color using Color3.fromRGB

 light3.Parent.Color = Color3.fromRGB(248, 217, 109)

1 comment

0

Thank you so much!

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