Codes={1234,1337,9001}Input=""InputDisabled=false Code=true Panel=script.Parent if Code then Panel.Code.Material="\078\101\111\110"end function DoInput(p)if InputDisabled or not Code then return end if string.len(Input)~=4 then Input=Input..p end if string.len(Input)==4 then local p=false for n,T in pairs(Codes)do if tostring(T)==Input then p=true end end if p then Panel.Code.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"Panel.Access.Material="\078\101\111\110"YourFunc()else Panel.Code.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"Panel.Denied.Material="\078\101\111\110"end wait(2)Input=""if Code then Panel.Code.Material="\078\101\111\110"end Panel.Access.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"Panel.Denied.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"end end function YourFunc()script.Parent.Parent.Open.Value=true end for p,n in pairs(script.Parent:GetChildren())do if n.Name:sub(1,3)=="\066\084\078"then n.ClickDetector.mouseClick:connect(function()DoInput(tonumber(n.Name:sub(4)))end)end end for p,n in pairs(script.Parent:GetChildren())do if n.Name:sub(1,2)=="\066\084"then n.ClickDetector.mouseClick:connect(function()Panel.Main.Beep:Play()end)end end

Codes = {1234,1337,9001} --Your code(Support multiple codes)
Input = ""

InputDisabled = false
Code = true

Panel = script.Parent

if Code then Panel.Code.Material = "Neon" end

function DoInput(Data)
	if InputDisabled or not Code then return end
	if string.len(Input) ~= 4 then
		Input = Input..Data
	end
	if string.len(Input) == 4 then
		local Accepted = false
		for _,l in pairs(Codes) do
			if tostring(l) == Input then Accepted = true end
		end
		if Accepted then 
			Panel.Code.Material = "SmoothPlastic"
			Panel.Access.Material = "Neon"
			YourFunc()
		else
			Panel.Code.Material = "SmoothPlastic"
			Panel.Denied.Material = "Neon"
		end
		wait(2)
		Input = ""
		if Code then
			Panel.Code.Material = "Neon"
		end
		Panel.Access.Material = "SmoothPlastic"
			Panel.Denied.Material = "SmoothPlastic"
	end
end

function YourFunc() --Script your function here
	script.Parent.Parent.Open.Value = true --For Teknikk Automatic Door
end

for _,l in pairs(script.Parent:GetChildren()) do
	if l.Name:sub(1,3) == "BTN" then
		l.ClickDetector.mouseClick:connect(function()
			DoInput(tonumber(l.Name:sub(4)))	
		end)	
	end
end


for _,l in pairs(script.Parent:GetChildren()) do
	if l.Name:sub(1,2) == "BT" then
		l.ClickDetector.mouseClick:connect(function()
			Panel.Main.Beep:Play()
		end)	
	end
end
