This might be annoying but i need help with a elevator

how do i put tween service in this script?? its for a car elevator.

local clickdetector2 = script.Parent.Parent.Parent.Button2.ClickDetector
local move = script.Parent.Parent.Parent.movingpart


clickdetector.MouseClick:Connect(function()
	
	move.Position = Vector3.new(88.926, 2.385, -14.951) -- start position
	wait(.2)
	move.Position = Vector3.new(88.926, 3.385, -14.951)
	wait(.2)
	move.Position = Vector3.new(88.926, 4.385, -14.951)
	wait(.2)
	move.Position = Vector3.new(88.926, 5.385, -14.951)
	wait(.2)
	move.Position = Vector3.new(88.926, 6.385, -14.951)
	wait(.2)
	move.Position = Vector3.new(88.926, 7.385, -14.951)
	wait(.2)
	move.Position = Vector3.new(88.926, 8.385, -14.951)
	wait(.2)
	move.Position = Vector3.new(88.926, 9.385, -14.951)
	wait(.2)
	move.Position = Vector3.new(88.926, 10.385, -14.951)
	wait(.2)
	move.Position = Vector3.new(88.926, 11.572, -14.951) -- end position
	
end)```
1 Like
local TweenService = game:GetService("TweenService")

local clickdetector = script.Parent.Parent.Parent.Button2.ClickDetector
local move = script.Parent.Parent.Parent.movingpart
	
move.Position = Vector3.new(88.926, 2.385, -14.951) -- start position

local goal = {}
goal.Position = Vector3.new(88.926, 11.572, -14.951)

local tweenInfo = TweenInfo.new(0.2*9)
 
local tween = TweenService:Create(move, tweenInfo, goal)

clickdetector.MouseClick:Connect(function()
	tween:Play()
end)

A couple days ago I made a “pathfindinng”/tweening plugin that allows you to tween parts. I don’t think it allows you to tween mutiple parts though…