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

How to make a specific color changing part which changes the two specific colors smoothly?

Asked by 3 years ago

I found a lot of tutorials on how to make a color changing block which changes colors smoothly but I cant find any which changes specific colors smoothly. (the colors I want to change smoothly are black and white)

0
Use TweenService. Ziffixture 6913 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
local TweenService = game:GetService("TweenService")

local part = --path to part

local tweenInfo = TweenInfo.new(
    2, -- Time
    Enum.EasingStyle.Linear, -- EasingStyle
    Enum.EasingDirection.Out, -- EasingDirection
    -1, -- RepeatCount (when less than zero the tween will loop indefinitely)
    true, -- Reverses (tween will reverse once reaching it's goal)
    0 -- DelayTime
)

local tween = TweenService:Create(part, tweenInfo, {Color = Color3.new(0,0,0)}) --or 255, 255, 255 if the part is black at first

tween:Play()
0
the third local has a problem MrAdrianGo 9 — 3y
0
it says syntax error: Expected identifier when parsing expression, got 'local' MrAdrianGo 9 — 3y
0
It's because you need to write the path for the second local. If you have the script under the part, you would do local part = script.Parent LeedleLeeRocket 1257 — 3y
0
thanks!! MrAdrianGo 9 — 3y
Ad

Answer this question