----- lock -----


lockInteractive.ClickDetector.MouseClick:Connect(function()
	if not doorOpen and not changingState then
		changingState = true
		if doorLocked then
			doorLocked = false
			interactive.ClickDetector.MaxActivationDistance = 12
			for i = 1, 5 do
				lock.CFrame = lock.CFrame * CFrame.new(0,0.02,0)
				handle.CFrame = handle.CFrame * CFrame.Angles(math.rad(-18),0,0)
				wait()
			end
		else
			doorLocked = true
			interactive.ClickDetector.MaxActivationDistance = 0
			for i = 1, 5 do
				lock.CFrame = lock.CFrame * CFrame.new(0,-0.02,0)
				handle.CFrame = handle.CFrame * CFrame.Angles(math.rad(18),0,0)
				wait()
			end
		end
		changingState = false
	end
end)
