I wanted to make this spawn model with lights change color at the same time smoothly, the problem is that it changes one part at a time and i’ve tried so many ways but nothing won’t change. Here is the code.
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
3, -- Time
Enum.EasingStyle.Cubic, -- EasingStyle
Enum.EasingDirection.In, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local colors = {
Color3.fromRGB(255, 0, 0);
Color3.fromRGB(255, 85, 0);
Color3.fromRGB(255, 255, 0);
Color3.fromRGB(0, 255, 0);
Color3.fromRGB(0, 255, 255);
Color3.fromRGB(0, 0, 255);
Color3.fromRGB(85, 0, 255);
Color3.fromRGB(255, 255, 255);
}
Model = script.Parent["Spawn Model"]
while true do
for i,v in pairs( colors) do
for i,Luci in pairs(script.Parent["Spawn Model"]:GetChildren()) do
if Luci.Name == "LightPart" then
local tween = TweenService:Create(Luci, tweenInfo, {Color = v})
tween:Play()
tween.Completed:Wait()
end
end
end
end