local dataLink = script["Data Link"].Value

local knob = script.Parent.Parent.ScanForTardis

local TweenService = game:GetService("TweenService")
local tweeningInfo = TweenInfo.new(.3, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
local properties = { CFrame = CFrame.new(-3.15021491, 6.95428562, 56.907917, -0.500016809, -0.295259267, 0.814128518, 0, 0.940085232, 0.34093985, -0.866015673, 0.170475677, -0.470058411); }
local tweenActivate = TweenService:Create(knob, tweeningInfo, properties)

local tweeningInfo = TweenInfo.new(.3, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
local properties = { CFrame = CFrame.new(-3.20756507, 6.93971252, 56.888958, 0.814128757, -0.295259625, 0.500016212, 0.340939641, 0.940085173, 8.57199439e-07, -0.470058113, 0.170474648, 0.86601603); }
local tweenDeactivate = TweenService:Create(knob, tweeningInfo, properties)

local running = false

function leftClick()
	if dataLink.isDataSingleSearchActive.Value then
		if dataLink.isDataScanningForTardis.Value == false then
			running = true
			tweenActivate:Play()
			dataLink.isDataScanningForTardis.Value = true

		elseif dataLink.isDataScanningForTardis.Value then
			running = true
			tweenDeactivate:Play()
			dataLink.isDataScanningForTardis.Value = false
		end
		running = false
		--script.Parent.Sound.Playing = true
	end
end


script.Parent.Use.MouseClick:connect(leftClick)

dataLink.isDataScanningForTardis.Changed:Connect(function()
	if not running then
		if dataLink.isDataScanningForTardis.Value then
			tweenActivate:Play()

		elseif not dataLink.isDataScanningForTardis.Value then
			tweenDeactivate:Play()
		end
	end
end)
