Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

1 comment

0

Use TweenService.

1 answer

✓ Accepted answer
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()

4 comments

0

the third local has a problem

0

it says syntax error: Expected identifier when parsing expression, got 'local'

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

0

thanks!!

This discussion is preserved as it was. New answers, comments, and votes are closed.