--created by
------------------------------------------
--Clear And Enter


function Clear()
	print("Cleared")
	script.Parent.B0.ClickS:Play()
Input = ""
end

script.Parent.Clear.ClickDetector.MouseClick:connect(Clear)




function Enter()
if Input == Code then
print("Entered")
Input = ""

		local door = script.Parent.Parent.Door
		local decal1 = script.Parent.Parent.Door.TEX1
		local decal2 = script.Parent.Parent.Door.TEX2
		
		door.CanCollide = false
		 decal1.Transparency = decal1.Transparency + .1
		decal2.Transparency = decal2.Transparency + .1
		-- OPENING SOUND -- 
		script.Parent.Parent.Door.OPEN:Play()
door.Transparency = door.Transparency + 0.1
		wait(TIEMPO)
	 	 decal1.Transparency = decal1.Transparency + .1
		  decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency + .1
		  decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency + .1
		  decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency + .1
		  decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency + .1
		  decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency + .1
		  decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency + .1
		  decal2.Transparency = decal2.Transparency + .1
door.Transparency = 0.8
		wait(3)
		-- CLOSING SOUND -- 
		script.Parent.Parent.Door.CLOSE:Play()
		 decal1.Transparency = decal1.Transparency - .1
		  decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency - .1
		  decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency - .1
		  decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency - .1
		  decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency - .1
		  decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency - .1
		  decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency - .1
		  decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
		wait(TIEMPO)
		 decal1.Transparency = decal1.Transparency - .1
		  decal2.Transparency = decal2.Transparency - .1
door.Transparency = 0
door.CanCollide = true



return end
Input = ""
	print("Wrong Code")
	if SounDebounce == true then
		SounDebounce = false
	script.Parent.B0.Wrong:Play()
	script.Parent.B0.Wrong.Ended:Wait()
		SounDebounce = true
		end
	
end




script.Parent.Enter.ClickDetector.MouseClick:connect(Enter)
