I've tried loads but the script seems too long too to be true surely am doing something wrong if I need to write the same lines over and over with just one number changing is there an easier way ??

local ts = game:GetService("TweenService")


local part = script.Parent


local Tweeninf = TweenInfo.new(
2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0.00000000000000000000000000000000000000000000000000000000000001
)
local move = {
CFrame = game.Workspace.Track1.CFrame
}
local move2 = {CFrame = game.Workspace.Track2.CFrame
}
local move3 = {CFrame = game.Workspace.Track3.CFrame
}
local move4 = {CFrame = game.Workspace.Track4.CFrame
}
local move5 = {CFrame = game.Workspace.Track5.CFrame
}
local move6 = {CFrame = game.Workspace.Track6.CFrame
}
local move7 = {CFrame = game.Workspace.Track7.CFrame
}
local move8 = {CFrame = game.Workspace.Track8.CFrame
}
local move9 = {CFrame = game.Workspace.Track9.CFrame
}
local move10 = {CFrame = game.Workspace.Track10.CFrame
}
local move11 = {CFrame = game.Workspace.Track11.CFrame
}
local move12 = {CFrame = game.Workspace.Track12.CFrame
}
local move13 = {CFrame = game.Workspace.Track13.CFrame
}
local move14 = {CFrame = game.Workspace.Track14.CFrame
}
local move15 = {CFrame = game.Workspace.Track15.CFrame
}
local move16 = {CFrame = game.Workspace.Track16.CFrame
}
local move17 = {CFrame = game.Workspace.Track17.CFrame
}




local tween1 = ts:Create(part,Tweeninf,move)
local tween2 = ts:Create(part,Tweeninf,move2)
local tween3 = ts:Create(part,Tweeninf,move3)
local tween4 = ts:Create(part,Tweeninf,move4)
local tween5 = ts:Create(part,Tweeninf,move5)
local tween6 = ts:Create(part,Tweeninf,move6)
local tween7 = ts:Create(part,Tweeninf,move7)
local tween8 = ts:Create(part,Tweeninf,move8)
local tween9 = ts:Create(part,Tweeninf,move9)
local tween10 = ts:Create(part,Tweeninf,move10)
local tween11 = ts:Create(part,Tweeninf,move11)
local tween12 = ts:Create(part,Tweeninf,move12)
local tween13 = ts:Create(part,Tweeninf,move13)
local tween14 = ts:Create(part,Tweeninf,move14)
local tween15 = ts:Create(part,Tweeninf,move15)
local tween16 = ts:Create(part,Tweeninf,move16)
local tween17 = ts:Create(part,Tweeninf,move17)


a = 0.7


while true do
wait(5)
tween1:Play()
wait(2)
tween1:Play()
wait(a)
tween2:Play()
wait(a)
tween3:Play()
wait(a)
tween4:Play()
wait(a)
tween5:Play()
wait(a)
tween6:Play()
wait(a)
tween7:Play()
wait(a)
tween8:Play()
wait(a)
tween9:Play()
wait(a)
tween10:Play()
wait(a)
tween11:Play()
wait(a)
tween12:Play()
wait(a)
tween13:Play()
wait(a)
tween14:Play()
wait(a)
tween15:Play()
wait(a)
tween16:Play()
wait(a)
tween17:Play()
wait(a)
end


6 comments

0

create a table and put all the cframe values in it. Then just loop through the table and play the tween.

0

Thank u but what if it has 1000 values lol is there a way of making the script make the table or something for u cuz it would take so long

0

Use ModuleScript to store the table.

0

use :GetChildren() to get a list of all the parts and loop through that

0

this is assuming all of your parts are stored inside the same parent