The problem is the close tween is never activated. No matter what the open tween is always the one to be activated when the RemoteEvent is fired. I'm trying to fix this. The OpenTween will work but the close won't, so it just turns 90 degrees every time it is clicked, eventually it does a full loop.
local TweenService = game:GetService("TweenService") local Remote = game.ReplicatedStorage.Remotes.Gate Remote.OnServerEvent:Connect(function(player,HingeLeft,HingeRight) local Closed = true if Closed then local Goal = {} Goal.CFrame = HingeLeft.CFrame:ToWorldSpace(CFrame.Angles(0, math.rad(-90), 0)) local Tween = TweenService:Create(HingeLeft, TweenInfo.new(5, Enum.EasingStyle.Linear), Goal) Tween:Play() HingeLeft.Parent.Parent.Sound:Play() else print('Close') local Goal = {} Goal.CFrame = HingeLeft.CFrame:ToWorldSpace(CFrame.Angles(0, math.rad(0), 0)) local Tween = TweenService:Create(HingeLeft, TweenInfo.new(5), Goal) Tween:Play() HingeLeft.Parent.Parent.Sound:Play() end end)