local P=script.Parent local F=true local t=false local s={["\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"]=false;["\091\083\067\080\093 \067\097\114\100-\076\050"]=false;["\091\083\067\080\093 \067\097\114\100-\076\049"]=false}function openDoor()for F=3,P.Size.z/.15,1 do wait()P.CFrame=P.CFrame-P.CFrame.lookVector*.15 end end function closeDoor()for F=3,P.Size.z/.15,1 do wait()P.CFrame=P.CFrame+P.CFrame.lookVector*.15 end end script.Parent.Parent.KeycardReader1.touched:connect(function(P)if P.Name=="\072\097\110\100\108\101"and(s[P.Parent.Name]and F==true)then F=false wait(.75)openDoor()wait(1)t=true elseif P.Name=="\072\097\110\100\108\101"and(s[P.Parent.Name]and t==true)then t=false wait(.75)closeDoor()wait(1)F=true end end)script.Parent.Parent.KeycardReader2.touched:connect(function(P)if P.Name=="\072\097\110\100\108\101"and(s[P.Parent.Name]and F==true)then F=false wait(.75)openDoor()wait(1)t=true elseif P.Name=="\072\097\110\100\108\101"and(s[P.Parent.Name]and t==true)then t=false wait(.75)closeDoor()wait(1)F=true end end)


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"] = false,
	["[SCP] Card-L2"] = false,
	["[SCP] Card-L1"] = false
}
						
						--DO NOT EDIT PAST THIS LINE--
function openDoor()
	for i = 3,(door.Size.z / 0.15) do
		wait()
		door.CFrame = door.CFrame - (door.CFrame.lookVector * 0.15)
	end
end

function closeDoor()
	for i = 3,(door.Size.z / 0.15) do
		wait()
		door.CFrame = door.CFrame + (door.CFrame.lookVector * 0.15)
	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)
