local N=script.Parent.ClickDetector function onMouseClick()if script.Parent.CanCollide==false then print("\067\108\111\115\101 \100\111\111\114")local N=script.Parent.Parent:GetChildren()for U=1,#N,1 do if N[U].className=="\080\097\114\116"or N[U].className=="\083\101\097\116"or N[U].className=="\087\101\100\103\101\080\097\114\116"or N[U].className=="\067\111\114\110\101\114\087\101\100\103\101\080\097\114\116"or N[U].className=="\086\101\104\105\099\108\101\083\101\097\116"or N[U].className=="\085\110\105\111\110\079\112\101\114\097\116\105\111\110"then if N[U].Name=="\087\105\110\100\111\119"then N[U].Transparency=.6 else N[U].Transparency=0 end N[U].CanCollide=true end end else print("\079\112\101\110 \100\111\111\114")local N=script.Parent.Parent:GetChildren()for U=1,#N,1 do if N[U].className=="\080\097\114\116"or N[U].className=="\083\101\097\116"or N[U].className=="\087\101\100\103\101\080\097\114\116"or N[U].className=="\067\111\114\110\101\114\087\101\100\103\101\080\097\114\116"or N[U].className=="\086\101\104\105\099\108\101\083\101\097\116"or N[U].className=="\085\110\105\111\110\079\112\101\114\097\116\105\111\110"then N[U].Transparency=1 N[U].CanCollide=false end end end end N.MouseClick:connect(onMouseClick)

	
local clickDetector = script.Parent.ClickDetector	

function onMouseClick()
	if script.Parent.CanCollide == false then
		print "Close door"
		local C = script.Parent.Parent:GetChildren()
		for i=1, #C do
			if (C[i].className == "Part") or (C[i].className == "Seat") or (C[i].className == "WedgePart") or (C[i].className == "CornerWedgePart") or (C[i].className == "VehicleSeat") or (C[i].className == "UnionOperation") then
			if C[i].Name == "Window" then
				C[i].Transparency = 0.6
			else
				C[i].Transparency = 0
			end
			C[i].CanCollide = true
			end
		end
	else
		print "Open door"
		local C = script.Parent.Parent:GetChildren()
		for i=1, #C do
			if (C[i].className == "Part") or (C[i].className == "Seat") or (C[i].className == "WedgePart") or (C[i].className == "CornerWedgePart") or (C[i].className == "VehicleSeat") or (C[i].className == "UnionOperation") then
			C[i].Transparency = 1
			C[i].CanCollide = false
			end
		end
	end
end	

clickDetector.MouseClick:connect(onMouseClick)
