Still have questions? Join our Discord server and get real time help.
0

# How do I make a part that slowly changes colors? (like a neon sign)

Asked by 9 months ago

I have an idea of how it'd work, but I can't test it right now, and I'm not sure if it's efficient. Could someone critique this?

```part = script.Parent
var = 0

while true do
number = var + 1
part.BrickColor = BrickColor.new(number,number,number)
wait(.001)
end
```

0
Answered by 9 months ago

0
Answered by 9 months ago
Edited 9 months ago

Do this:

```part = script.Parent
x = math.random(1,255)
y = math.random(1,255)
z = math.random(1.255)

while true do
part.BrickColor = Color3.new(x,y,z)
wait(1)
end

```

Color3 objects will create new colors. Making it change colors would look like:

```while true do
script.Parent.BrickColor = BrickColor.Random()
wait(1)
end
```
0
Fifkee 256
9 months ago

Really nice rainbow script right here.

```frequency = 0.05
local rainbow = function (i)
local r = math.sin(frequency*i + 0) * 127 + 128;
local g = math.sin(frequency*i + (2*math.pi/3)) * 127 + 128;
local b = math.sin(frequency*i + (4*math.pi/3)) * 127 + 128;

return Color3.fromRGB(r, g, b)
end
local i = 1
while wait() do
part.Color3 = rainbow(i)
i = i+1
end
```