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






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)
