-- 1Topcop


bin = script.Parent

openTime = 1
closeTime = 0

openState = bin.DoorScript.open

function touch(hit)
	if hit.Parent == nil then return end
	local p = game.Players:playerFromCharacter(hit.Parent)
	if p ~= nil then
		if openState.Value then
			cTime = openTime -- Prolong open time
		else
			openState.Value = true
			cTime = openTime
			while cTime > 0 do
				wait(0.1)
				cTime = cTime - 0.1
			end
			openState.Value = false
		end
	end
end

bin.trigger1.Touched:connect(touch)
bin.trigger2.Touched:connect(touch)
