Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Fade in and out colors script?

Asked by 10 years ago

I am trying to make it so that the parent of the script (the part) will fade colors in and out. I am fairly new to scripting so this is probably wrong.

01while true do
02    script.Parent:connect(function(a,b,c)
03    for i = 1, 255 do
04        script.Parent.Color = Color3.new(+1, +1, +1)
05    end
06end)
07if a = 255 and b = 255 and c = 255 then
08    for i = -1,255 do
09        script.Parent.Color = Color3.new(-1, -1, -1)
10    end
11end
12if a = 0 and b = 0 and c = 0 then
13    for i = 1,255 do
14        script.Parent.Color = Color3.new(+1, +1, +1)
15    end
16end
17 
18end
0
I think the for loops are where I went wrong raystriker6707 30 — 10y

1 answer

Log in to vote
0
Answered by
tumadrina 179
10 years ago
01while wait() do
02    for i=0,255 do
03    wait()
04    script.Parent.BrickColor=BrickColor.new(Color3.new(i/255,i/255,i/255))
05        if i==255 then
06            for i=255,0,-1 do
07            wait()
08            script.Parent.BrickColor=BrickColor.new(Color3.new(i/255,i/255,i/255))
09            end
10        end
11    end
12end

that is probably not the effects you wanted but that is the best I could do from your script. errors I noticed were you didn't put a wait() , Color isn't a part's property,and if you add Color3, it only accepts numbers 0-1

Ad

Answer this question