Cannot tween a door twice

I have problem. I can’t tween an object twice, I’ve read like a lot of posts about this problem but there solution is to always put all the properties into one table. I know this already but my case is different. I want to tween a door to open with one proximity prompt that is enabled and when the door is open, I want that prompt to disable itself and enable a closing prompt which closes the door. I have tried achieving this by putting two separate scripts for each prompt/tween but it isn’t working.

Workspace:
image

Script Open:

local door = script.Parent

local proximityOpen = door.Open
proximityOpen.Enabled = true

local proximityClose = door.Close
proximityClose.Enabled = false

local TweenService = game:GetService("TweenService")

--/ Tween for opening the door --/

local tweenInfoOpen = TweenInfo.new(
	1,
	Enum.EasingStyle.Cubic,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)
local propTweenOpen = {
	Orientation = Vector3.new(0, 90, 0),
	Position = Vector3.new(18.043, 4.5, 8.983)
}
local tweenOpen = TweenService:Create(door, tweenInfoOpen, propTweenOpen)

--/ Proximity prompts for opening the door --/

if proximityOpen.Enabled == true then
	
	proximityOpen.Triggered:Connect(function()
		tweenOpen:Play()
		proximityClose.Enabled = true
		proximityOpen.Enabled = false
	end)
end

Script Close:

local door = script.Parent
local proximityPromptOpen = door.Open
local proximityPromptClose = door.Close

local TweenService = game:GetService("TweenService")

local tweenInfoClose = TweenInfo.new(
	1,
	Enum.EasingStyle.Cubic,
	Enum.EasingDirection.In,
	0,
	false,
	0
)

local propTweenClose = {
	Orientation = Vector3.new(0, 0, 0),
	Position = Vector3.new(16.554, 4.5, 10.983)
}

local tweenClose = TweenService:Create(door, tweenInfoClose, propTweenClose)

if proximityPromptClose.Enabled == true then
	proximityPromptClose.Triggered:Connect(function()
		tweenClose:Play()
		proximityPromptClose.Enabled = false
		proximityPromptOpen.Enabled = true
	end)
end

I am not asking for anyone to make scripts for me, just please tell me how I can tween the door twice.

Take the connection out of this if statement. The proximity prompt is disabled at the start, so it won’t connect this event. Same as the other one, maybe add a debounce to it as well.

Could you go more in depth of what you meant? I couldn’t understand.

So initially, it checks if the prompt to close the door is enabled, which then sees that it is not. Because of this, it won’t run the code inside your if statement. Remove that if statement and you should be good.

Thanks a lot! I haven’t thought that just removing an if statement could fix it.