Keep the player on a platform while its moving

Even after researching, i am even more confused on how do this.

i am moving the model using for i loop and a CFrame.new():Lerp() function

local function MoveModel(NewPos: Vector3)
	if MOVING then return end
	MOVING = true
	
	local NewCFrame = CFrame.new(NewPos)
		
	for i = 0, 0.12, 0.001 do
		local Change = MainModel:GetPivot():Lerp(NewCFrame * MainModel:GetPivot().Rotation, i)
		MainModel:PivotTo(Change)
		task.wait(0.01)
	end
	
	MOVING = false
end

test this:

local function MoveModel(NewPos: Vector3)
    if MOVING then return end
    MOVING = true

    local CurrentRotation = MainModel:GetPivot().Rotation
    local TargetCFrame = CFrame.new(NewPos) * CurrentRotation

    for i = 0, 1, 0.02 do
        local Change = MainModel:GetPivot():Lerp(TargetCFrame, i)
        MainModel:PivotTo(Change)
        task.wait(0.01)
    end

    MOVING = false
end

thats not issue i am facing, as you see it doesnt keep the player on the platform

You can’t do this through a script. Weld the model together and create a hinge constraint that will move it and a script that will activate it. It fixed that problem when i had it.

If you want the player to stay on the platform you either have to code it, such that the player gets moved with the platform(But I don’t know an efficient way to do it so I’m not able to provide a good way) or use physical constraints to move the platform(Physical Constraints automatically move the player along)

Make a Moving Platform that Moves Players
Moving Platform with Players

And one of my testing programs for a lift.
ElevatorTest_03.rbxl (66.2 KB)
^- this is better than you think .. take a look.