Here is the script
local TweenService = game:GetService("TweenService")
local Elevator = game.Workspace.Elevator
local TweenInfo = TweenInfo.new(20, Enum.EasingStyle.Quart,
Enum.EasingDirection.InOut)
local UPElevator = TweenService:Create(Elevator, TweenInfo, {
["Position"] = Vector3.new(-108.728, 629.754, 14.857)
})
local DownElevator = TweenService:Create(Elevator, TweenInfo, {
["Position"] = Vector3.new(-108.728, 1.854, 14.857)
})
local PlayerPartTable = {}
Elevator.Touched:Connect(function(part)
if part.Parent:FindFirstChild("Humanoid") then
table.insert(PlayerPartTable, part)
end
end)
Elevator.TouchEnded:Connect(function(part)
if part.Parent:FindFirstChild("Humanoid") then
table.remove(PlayerPartTable, table.find(PlayerPartTable, part))
end
end)
while true do
task.wait(5)
for _, v in pairs(PlayerPartTable) do
v.Anchored = false
local Weld = Instance.new("Weld", v)
Weld.Part0 = v
Weld.Part1 = Elevator
end
DownElevator:Play()
task.wait(20)
task.wait(10)
UPElevator:Play()
task.wait(20)
end
But in game the player is welded like that
The elevator is a union part and look like that
Thank you !