Help my script doesnt work but does print breakpoints

I got the problem that the color of neon doesnt change when it meets the requirmentrs and instead of recoloring te neon part it prints “not” does anyone know what to do I check or the color cods were correct

local Check1 = script.Parent.Parent.Change1
local Check2 = script.Parent.Parent.Change2


local function ColorNeon()
	print("changed")
	if Check1.Color == Color3.new(0.666667, 1, 0.498039) and Check2.Color == Color3.new(0.666667, 1, 0.498039) then
		script.Parent.Neon.Color = Color3.new(0.541176, 0.670588, 0.521569)
	else
		print("not")
	end
end

Check1.Changed:Connect(ColorNeon)
Check2.Changed:Connect(ColorNeon)

Colors are in RGB values for everything, so using Color3.new(1,1,1) for example is like asking for RGB of 1 each when it can be 255. Use Color3.fromRGB when you are doing this kind of stuff.

1 Like

Well thx for learning me that I can use from rgb instead of new thats really usefull but I still have the same issue

Print the Color3 values before the if statements.
I’m betting it’s a decimal difference issue. For example when your if statement reads
if variable == 0.6667
and the variable value in game is
0.667
then the if doesn’t allow the rest of the code to run.