Hello, I have a tween that changes the color of parts to purple. The script works fine for about 10 seconds, but then the colors start becoming random. I only have this script in an empty baseplate, and no free models.
This gif shows what it looks like.
Here is the entire script I’m using.
local tweenService = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(
.75,
Enum.EasingStyle.Back,
Enum.EasingDirection.In,
1,
true
)
local num = 0
while wait() do
for i = 1, #script.Parent:GetChildren() do
wait()
if not (num == (#script.Parent:GetChildren() + 1)) then
num +=1
if script.Parent:FindFirstChild(num) then
local tween = tweenService:Create(script.Parent:FindFirstChild(num), tweeninfo, {Color = Color3.fromRGB(167, 94, 155)})
tween:Play()
wait()
end
else
num = 0
end
end
end
Any help would be appreciated, thanks!
I figured out what I was doing wrong, the Tweens were overlapping each other causing the random colors. Thanks!