Tween Doors only working in certain experiences

So I have a issue regarding my doors that aren’t functioning; the script seems to function as it works on other places. However, whenever I import them into my main place for development - after a few days, the doors no longer opens and will not display its animation. The script does work, however what issues could occur for this to happen? I don’t see any issues regarding the model/script itself - as it works but then breaks.

Testing Place, functional doors that didn’t require replacements.

Main Studio, requiring repeating imports for them to work - video displays the dev console showing the script works, explorer showing the connection of the model & how the doors are not functioning.

The script.

local tweenService = game:GetService("TweenService")

local isOpen = false
local canOpen = true

local hingeLeft = script.Parent.Parent.Parent.DoorLeft.Hinge2
local hingeRight = script.Parent.Parent.Parent.DoorRight.Hinge

script.Parent.Triggered:Connect(function(player)
		local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
		local goalLeft
		local goalRight
		local currentCFrameLeft = hingeLeft.CFrame
		local currentCFrameRight = hingeRight.CFrame

		if canOpen then
			canOpen = false

			if not isOpen then
				isOpen = true
				goalLeft = {CFrame = currentCFrameLeft * CFrame.Angles(0, math.rad(90), 0)}
				goalRight = {CFrame = currentCFrameRight * CFrame.Angles(0, math.rad(-90), 0)}
			else
				isOpen = false
				goalLeft = {CFrame = currentCFrameLeft * CFrame.Angles(0, math.rad(-90), 0)}
				goalRight = {CFrame = currentCFrameRight * CFrame.Angles(0, math.rad(90), 0)}
			end

			local tweenLeft = tweenService:Create(hingeLeft, tweenInfo, goalLeft)
			local tweenRight = tweenService:Create(hingeRight, tweenInfo, goalRight)
			tweenLeft:Play()
			tweenRight:Play()
			tweenLeft.Completed:Wait()
			canOpen = true
		end
end)
1 Like

Instead of tweenleft.Completed:Wait() try
Tweenleft.Completed:Connect(function()
canOpen = true
end)
Let me know if it works

Thanks, but no, this didn’t work.