Hi, I just created a relatively long code and I’m about one hundred percent sure it could be shorter.
local TweenService: TweenService = game:GetService("TweenService")
local part: Part = script.Parent
local positions = {
["0"] = part.Position,
["1"] = Vector3.new(-336.664, 6.061, -2165.951),
["2"] = Vector3.new(-331.664, 6.061, -2135.951),
["3"] = Vector3.new(-326.664, 6.061, -2165.951),
["4"] = Vector3.new(-321.664, 6.061, -2135.951),
["5"] = Vector3.new(-316.664, 6.061, -2165.951),
["6"] = Vector3.new(-311.664, 6.061, -2135.951),
["7"] = Vector3.new(-306.664, 6.061, -2165.951),
["8"] = Vector3.new(-301.664, 6.061, -2135.951),
["9"] = Vector3.new(-296.664, 6.061, -2165.951),
["10"] = Vector3.new(-291.664, 6.061, -2135.951),
["11"] = Vector3.new(-286.664, 6.061, -2165.951),
["12"] = Vector3.new(-281.664, 6.061, -2135.951),
["13"] = Vector3.new(-276.664, 6.061, -2165.951),
["14"] = Vector3.new(-271.664, 6.061, -2135.951),
["15"] = Vector3.new(-266.664, 6.061, -2165.951),
["16"] = Vector3.new(-261.664, 6.061, -2135.951),
["17"] = Vector3.new(-256.664, 6.061, -2165.951),
["18"] = Vector3.new(-251.664, 6.061, -2135.951),
["19"] = Vector3.new(-246.664, 6.061, -2165.951),
["20"] = Vector3.new(-241.664, 6.061, -2135.951),
["21"] = Vector3.new(-236.664, 6.061, -2165.951),
["22"] = Vector3.new(-231.664, 6.061, -2135.951),
["23"] = Vector3.new(-226.664, 6.061, -2165.951),
["24"] = Vector3.new(-221.664, 6.061, -2135.951),
["25"] = Vector3.new(-216.664, 6.061, -2165.951),
["26"] = Vector3.new(-211.664, 6.061, -2135.951),
["27"] = Vector3.new(-206.664, 6.061, -2165.951),
["28"] = Vector3.new(-201.664, 6.061, -2135.951),
}
local tweenInfo0: TweenInfo = TweenInfo.new(
0.5,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
-1,
true
)
while true do
TweenService:Create(part, tweenInfo0, {Position = positions["1"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["2"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["3"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["4"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["5"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["6"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["7"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["8"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["9"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["10"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["11"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["12"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["13"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["14"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["15"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["16"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["17"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["18"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["19"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["20"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["21"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["22"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["23"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["24"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["25"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["26"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["27"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["28"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["27"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["26"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["25"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["24"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["23"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["22"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["21"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["20"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["19"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["18"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["17"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["16"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["15"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["14"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["13"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["12"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["11"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["10"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["9"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["8"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["7"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["6"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["5"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["4"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["3"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["2"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["1"]}):Play()
task.wait(tweenInfo0.Time)
TweenService:Create(part, tweenInfo0, {Position = positions["0"]}):Play()
task.wait(tweenInfo0.Time)
end