Tweening of Vault Door can be impeded by player(s) - How to Prevent it?

I have a vault door that tweens open and closed with input from a player via a proximity prompt, as seen in the below code:

--- local script
local pp = game:GetService("ProximityPromptService")
pp.PromptTriggered:Connect(function(prompt: ProximityPrompt, playerWhoTriggered: Player) 
	if prompt.Parent then
		if prompt.Name == "vaultDoor" then
			local door = prompt.Parent.Parent
			if door and door.Name == "armoryVaultDoor" then
				replicatedStorage.events.server.vaultDoor:FireServer(door)
			end	
		end
	end	
end)
---server script
ReplicatedStorage.events.server.vaultDoor.OnServerEvent:Connect(function(player: Player, door: Model) 
	if door:GetAttribute("inProgress") then return end
	local x,y,z = door.PrimaryPart.CFrame:ToOrientation()

	local info = TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
	if door:GetAttribute("open") == true then
		local old = Vector3.new(x,y-90,z)
		tweenModule.TweenModuleOrientation(door,info,old,true,true) 
	else
		local new = Vector3.new(x,y+90,z)
		tweenModule.TweenModuleOrientation(door,info,new,true,false)
	end
	local sound = door:FindFirstChildWhichIsA("Sound",true)
	if sound then
		sound:Play()
	end
end)

However, when opening closing, the door(s) never really close all the way, and a player can cause the doors to close even less properly, as seen below:


This was not an issue when I first tested this system, but that was when I tested it where the buildings these doors were in weren’t at certain angles, as seen with the placement system below:

I have no idea what the issue is, can someone help?
Here is the code that tweens the door open/closed:

function module.TweenModuleOrientation(Model,Tweeninfo,oOrinetation,isDoor,openStatus)
	if typeof(Model) ~= "Instance" then error(Model.." isnt a instance") end
	if not Model:IsA("Model") then error(Model.Name.." isnt a model") end
	if not Model.PrimaryPart then Model.PrimaryPart = Model:FindFirstChildWhichIsA("BasePart") end
	local prompt = Model:FindFirstChildWhichIsA("ProximityPrompt",true)
	if isDoor then
		if prompt then
			prompt.Enabled = false
		end
		Model:SetAttribute("inProgress",true)
	end

	task.spawn(function()
		local Primary = Model.PrimaryPart
		local AnchorState = Primary.Anchored

		local TW = TS:Create(Primary,Tweeninfo,{CFrame = Primary.CFrame * CFrame.Angles(math.rad(oOrinetation.X),math.rad(oOrinetation.Y),math.rad(oOrinetation.Z))})

		for _,v in pairs(Model:GetDescendants()) do
			if v:IsA("BasePart") and v ~= Primary then
				local weld
				if not v:FindFirstChild("TweenWeld") then
					weld = Instance.new("WeldConstraint")
					weld.Part0 = Primary
					weld.Part1 = v
					weld.Parent = v
					weld.Name = "TweenWeld"
				else
					weld = v:FindFirstChild("TweenWeld")
					weld.Enabled = true
				end

				local anchord = v.Anchored
				v.Anchored = false
				task.spawn(function()
					TW.Completed:Wait()

					weld.Enabled = false
					v.Anchored = anchord
				end)
				
				continue
			end
			if v:IsA("Weld") or v:IsA("WeldConstraint") or v:IsA("ManualWeld") or v:IsA("Motor6D") then
				if v.Name ~= "TweenWeld" then
					v.Enabled = false
					task.spawn(function()
						TW.Completed:Wait()

						v.Enabled = true
					end)
				end
				
				continue
			end
			
			task.wait()
		end

		TW:Play()
		TW.Completed:Wait()
		if isDoor then
			if openStatus then
				prompt.ActionText = "Open"
				Model:SetAttribute("open",nil)
			else
				prompt.ActionText = "Close"
				Model:SetAttribute("open",true)
			end
			Model:SetAttribute("inProgress",nil)
			if prompt then
				prompt.Enabled = true
			end
		end

		Primary.Anchored = AnchorState
	end)
	return
end

The above code is from here

One way to fix this is by setting the door Model’s CFrame back to the original when it closes. To do this, you’ll first have to pass in the CFrame information of the closed door, and I’m assuming that the door is closed by default, so that CFrame can be collected by adding this variable at the beginning of the server script (The one that handles the ProximityPrompt):

local originalCFrame = door:GetPivot() -- replace "door" with the actual door model

Now when the TweenModelOrientation function is called, you can add the CFrame info when needed. Here’s an updated version of your server script (the part where the function is called):

if door:GetAttribute("open") == true then
    local old = Vector3.new(x,y-90,z)
    tweenModule.TweenModuleOrientation(door,info,old,true,true,originalCFrame) -- This is where the new variable is added
else
    local new = Vector3.new(x,y+90,z)
    tweenModule.TweenModuleOrientation(door,info,new,true,false,nil) -- We don't need the old CFrame because we are opening the door
end

For the third step, you’ll need to go to the module script to add the new parameter:

function module.TweenModuleOrientation(Model,Tweeninfo,orientation,isDoor,openStatus,originalCFrame)

Finally, for the last step, you’ll go to where the tween is played (in the module script), and add one piece of code after the animation ends:

if isDoor then
    if openStatus then
        prompt.ActionText = "Open"
        Model:SetAttribute("open",nil)

        Model:PivotTo(originalCFrame) -- The door fixes itself here :)
    else
        prompt.ActionText = "Close"
        Model:SetAttribute("open",true)

Now, the door should snap into place when it’s closed. Hope this helped!