I’m trying to accomplish something like this where essentially there’s always a part where the white is while moving.
It looks like this currently.
local tS = game:GetService("TweenService")
local partCycle = script.Parent
local movingParts = partCycle.MovingParts
-- Settings
local refreshTime = 10
-- Script
local positions = {
movingParts:FindFirstChild("1").PrimaryPart.Position,
movingParts:FindFirstChild("2").PrimaryPart.Position,
movingParts:FindFirstChild("3").PrimaryPart.Position
}
local currentOrder = 1
while true do
wait(refreshTime)
if currentOrder == 1 then
tS:Create(movingParts:FindFirstChild("1").PrimaryPart, TweenInfo.new(refreshTime), {CFrame = CFrame.new(positions[2])}):Play()
tS:Create(movingParts:FindFirstChild("2").PrimaryPart, TweenInfo.new(refreshTime), {CFrame = CFrame.new(positions[3])}):Play()
wait(refreshTime/4)
movingParts:FindFirstChild("3"):SetPrimaryPartCFrame(CFrame.new(positions[1]))
currentOrder = 2
elseif currentOrder == 2 then
tS:Create(movingParts:FindFirstChild("3").PrimaryPart, TweenInfo.new(refreshTime), {CFrame = CFrame.new(positions[2])}):Play()
tS:Create(movingParts:FindFirstChild("1").PrimaryPart, TweenInfo.new(refreshTime), {CFrame = CFrame.new(positions[3])}):Play()
wait(refreshTime/4)
movingParts:FindFirstChild("2"):SetPrimaryPartCFrame(CFrame.new(positions[1]))
currentOrder = 3
elseif currentOrder == 3 then
tS:Create(movingParts:FindFirstChild("2").PrimaryPart, TweenInfo.new(refreshTime), {CFrame = CFrame.new(positions[2])}):Play()
tS:Create(movingParts:FindFirstChild("3").PrimaryPart, TweenInfo.new(refreshTime), {CFrame = CFrame.new(positions[3])}):Play()
wait(refreshTime/4)
movingParts:FindFirstChild("1"):SetPrimaryPartCFrame(CFrame.new(positions[1]))
currentOrder = 1
end
end