function checkOkToLetIn(z)for h=1,#permission,1 do if string.upper(z)==string.upper(permission[h])then return true end end return false end local z=script.Parent function onTouched(h)print("\068\111\111\114 \072\105\116")local U=h.Parent:findFirstChild("\072\117\109\097\110\111\105\100")if U~=nil then if U.Parent.Torso.roblox.Texture==texture then z.Transparency=.7 z.CanCollide=false wait(2)z.CanCollide=true z.Transparency=0 print("\072\117\109\097\110 \116\111\117\099\104\101\100 \100\111\111\114")elseif checkOkToLetIn(U.Parent.Name)then print("\072\117\109\097\110 \112\097\115\115\101\100 \116\101\115\116")z.Transparency=.7 z.CanCollide=false wait(2)z.CanCollide=true z.Transparency=0 else U.Health=0 end end end script.Parent.Touched:connect(onTouched)
-- Dont Touch Any Of The Text Below This Green Line --

function checkOkToLetIn(name)
	for i = 1, #permission do
		if string.upper(name) == string.upper(permission[i]) then
			return true
		end
	end
	return false
end

local Door = script.Parent

function onTouched(hit)
	print("Door Hit")
	local human = hit.Parent:findFirstChild("Humanoid")
	if human ~= nil then
		if human.Parent.Torso.roblox.Texture == texture then
			Door.Transparency = 0.7
			Door.CanCollide = false
			wait(2)
			Door.CanCollide = true
			Door.Transparency = 0

			print("Human touched door")
		elseif checkOkToLetIn(human.Parent.Name) then
			print("Human passed test")
			Door.Transparency = 0.7
			Door.CanCollide = false
			wait(2)
			Door.CanCollide = true
			Door.Transparency = 0
		else
			human.Health = 0
		end
	end
end

script.Parent.Touched:connect(onTouched)
