local F=script.Parent local c=true local b=false local D={["\091\083\067\080\093 \067\097\114\100-\079\109\110\105"]=true;["\091\083\067\080\093 \067\097\114\100-\076\053"]=true,["\091\083\067\080\093 \067\097\114\100-\076\052"]=true,["\091\083\067\080\093 \067\097\114\100-\076\051"]=true,["\091\083\067\080\093 \067\097\114\100-\076\050"]=true,["\091\083\067\080\093 \067\097\114\100-\076\049"]=true}function openDoor()for c=1,F.Size.z/.3,1 do wait()F.CFrame=F.CFrame-F.CFrame.lookVector*.3 end end function closeDoor()for c=1,F.Size.z/.3,1 do wait()F.CFrame=F.CFrame+F.CFrame.lookVector*.3 end end script.Parent.Parent.KeycardReader1.touched:connect(function(F)if F.Name=="\072\097\110\100\108\101"and(D[F.Parent.Name]and c==true)then c=false wait(.75)openDoor()wait(1)b=true elseif F.Name=="\072\097\110\100\108\101"and(D[F.Parent.Name]and b==true)then b=false wait(.75)closeDoor()wait(1)c=true end end)script.Parent.Parent.KeycardReader2.touched:connect(function(F)if F.Name=="\072\097\110\100\108\101"and(D[F.Parent.Name]and c==true)then c=false wait(.75)openDoor()wait(1)b=true elseif F.Name=="\072\097\110\100\108\101"and(D[F.Parent.Name]and b==true)then b=false wait(.75)closeDoor()wait(1)c=true end end)
--"False" = Not Acceptable Keycard To Open. "True" = Acceptable Keycard To Open.--

local door = script.Parent
local CanOpen1 = true
local CanClose1 = false
local clearance = {
	["[SCP] Card-Omni"] = true,
	["[SCP] Card-L5"] = true,
	["[SCP] Card-L4"] = true,
	["[SCP] Card-L3"] = true,
	["[SCP] Card-L2"] = true,
	["[SCP] Card-L1"] = true,
}

--DO NOT EDIT PAST THIS LINE--
function openDoor()
	for i = 1, (door.Size.z / 0.30) do
		wait()
		door.CFrame = door.CFrame - (door.CFrame.lookVector * 0.30)
	end
end

function closeDoor()
	for i = 1, (door.Size.z / 0.30) do
		wait()
		door.CFrame = door.CFrame + (door.CFrame.lookVector * 0.30)
	end
end

script.Parent.Parent.KeycardReader1.touched:connect(function(touch)
	if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
		CanOpen1 = false
		wait(0.75)
		openDoor()
		wait(1)
		CanClose1 = true
	elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
		CanClose1 = false
		wait(0.75)
		closeDoor()
		wait(1)
		CanOpen1 = true
	end
end)

script.Parent.Parent.KeycardReader2.touched:connect(function(touch)
	if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
		CanOpen1 = false
		wait(0.75)
		openDoor()
		wait(1)
		CanClose1 = true
	elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
		CanClose1 = false
		wait(0.75)
		closeDoor()
		wait(1)
		CanOpen1 = true
	end
end)
