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.

while true do
    script.Parent:connect(function(a,b,c)
    for i = 1, 255 do
        script.Parent.Color = Color3.new(+1, +1, +1)
    end
end)
if a = 255 and b = 255 and c = 255 then
    for i = -1,255 do
        script.Parent.Color = Color3.new(-1, -1, -1)
    end
end
if a = 0 and b = 0 and c = 0 then
    for i = 1,255 do
        script.Parent.Color = Color3.new(+1, +1, +1)
    end
end

end
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
while wait() do
    for i=0,255 do
    wait()
    script.Parent.BrickColor=BrickColor.new(Color3.new(i/255,i/255,i/255))
        if i==255 then
            for i=255,0,-1 do
            wait()
            script.Parent.BrickColor=BrickColor.new(Color3.new(i/255,i/255,i/255))
            end
        end
    end
end

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