Closed=true function LockItems()Timer.EnclosureDoor.Buttons.Locked.Value=script.Locked.Value if script.Locked.Value==true then Timer.EnclosureDoor.Locked.Value=script.Locked.Value Timer.EnclosureDoor.Interactive.ProximityPromptService.MaxActivationDistance=0 else Timer.EnclosureDoor.Interactive.ProximityPromptService.MaxActivationDistance=8 end end script.Parent.Touched:connect(function(J)if J~=nil and(J.Parent~=nil and(J.Parent:FindFirstChild("\067\097\114\100\078\117\109\098\101\114")~=nil and J.Parent.CardNumber.Value==0))then if Closed==true then Closed=1 script.Locked.Value=false LockItems()script.Parent.Open.Value=true wait(1)Closed=false return end if Closed==false and Timer.EnclosureDoor.DoorOpen.Value==false then Closed=1 script.Locked.Value=true LockItems()script.Parent.Open.Value=false wait(1)Closed=true return end end end)



Closed = true

function LockItems()
	Timer.EnclosureDoor.Buttons.Locked.Value = script.Locked.Value
	if script.Locked.Value == true then
		Timer.EnclosureDoor.Locked.Value = script.Locked.Value
		Timer.EnclosureDoor.Interactive.ProximityPromptService.MaxActivationDistance = 0
	else
		Timer.EnclosureDoor.Interactive.ProximityPromptService.MaxActivationDistance = 8
	end
end

script.Parent.Touched:connect(function(P)
	if P ~= nil and P.Parent ~= nil and P.Parent:FindFirstChild("CardNumber") ~= nil  and P.Parent.CardNumber.Value == 0 then
		if Closed == true then
			Closed = 1
			script.Locked.Value = false
			LockItems()
			script.Parent.Open.Value = true
			wait(1)
			Closed = false
			return
		end
		if Closed == false and Timer.EnclosureDoor.DoorOpen.Value == false then
			Closed = 1
			script.Locked.Value = true
			LockItems()
			script.Parent.Open.Value = false
			wait(1)
			Closed = true
			return
		end

	end
end)
