Try using WeldConstraint. When the Tween is played, you create the WeldConstraint immediately.
Tween:Play()
local weldConstraint = Instance.new("WeldConstraint")
Next, make sure your elevator model has a PrimaryPart, or an invisible part in the middle of the model that connects all of the instances/parts inside that model. (like the HumanoidRootPart of the character)
The Part0 of the constraint should be the player's HumanoidRootPart or torso, and the Part1 should be the PrimaryPart of the elevator.
(if this script below doesn't work, try making the PrimaryPart of the model and edit the PrimaryPart of the model by clicking the model and click PrimaryPart under Pivot, and click the part or the middle invisible part of the elevator that serves as an anchor)
If you're lazy to read the above if the script below doesn't work (lol) then just edit the PrimaryPart in the script into any part from the model. (like turning weldConstraint.Part1 = model.PrimaryPart to weldConstraint.Part1 = model."AnyPartNameHere")
weldConstraint.Part0 = (plr.Character or plr.CharacterAdded:Wait()):FindFirstChild("HumanoidRootPart") or (plr.Character or plr.CharacterAdded:Wait()):FindFirstChild("Torso")
weldConstraint.Part1 = model.PrimaryPart
weldConstraint.Parent = model.PrimaryPart
weldConstraint.Name = "CharacterMeldWeld"
Then after that, add wait() or task.wait() and inside the parenthesis, add the length of the tween plays. (no difference between wait() and task.wait() but task.wait() is more precise and much recommend to use)
task.wait(
And after that, remove the WeldConstraint so the player can move freely. (the player cannot move if the elevator is going up or down because of WeldConstraint)
local theConsTraintWeldPart = model.PrimaryPart
theConsTraintWeldPart.CharacterMeldWeld:Destroy()
You're done! I used this method in one of my games used for testing. (If you're wondering what game, here it is! https://web.roblox.com/games/9393617137/jiafei-horror-game-test and I'M NOT ADVERTISING MY GAME!)
Lemme know if there are errors or mistakes, or parts you don't understand. Have a good day! ^^
1 comment
Try using BodyPositions!