local function Z(Z,e,Q,I,f,Y)if not Q or typeof(Q)~="\116\097\098\108\101"then error("\067\097\108\108 \105\110 \067\097\115\116\066\108\097\099\107\108\105\115\116 \102\097\105\108\101\100\033 \066\108\097\099\107\108\105\115\116 \116\097\098\108\101 \105\115 \101\105\116\104\101\114 \110\105\108\044 \111\114 \105\115 \110\111\116 \097\099\116\117\097\108\108\121 \097 \116\097\098\108\101\046",0)end local W=Ray.new(Z,e)local z,P,U,D=nil,Z+e,Vector3.new(0,1,0),Enum.Material.Air local M=false repeat z,P,U,D=Workspace:FindPartOnRayWithIgnoreList(W,Q,false,I)if z then local Z=z:FindFirstAncestorOfClass("\077\111\100\101\108")local e=Z and Z:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")if z.Transparency>.75 or z.Name=="\077\105\115\115\105\108\101"or z.Name=="\072\097\110\100\108\101"or z.Name=="\069\102\102\101\099\116"or z.Name=="\066\117\108\108\101\116"or z.Name=="\076\097\115\101\114"or string.lower(z.Name)=="\119\097\116\101\114"or z.Name=="\082\097\105\108"or z.Name=="\065\114\114\111\119"or e and(e.Health==0 or not DamageModule.CanDamage(Z,f,Y))then table.insert(Q,z)M=false else M=true end else M=true end until M return z,P,U,D end

local function CastWithBlacklistAndNoHumPenetration(origin, direction, blacklist, ignoreWater, character, friendlyFire)
	if not blacklist or typeof(blacklist) ~= "table" then
		-- This array is faulty
		error("Call in CastBlacklist failed! Blacklist table is either nil, or is not actually a table.", 0)
	end
	local castRay = Ray.new(origin, direction)
	local hitPart, hitPoint, hitNormal, hitMaterial = nil, origin + direction, Vector3.new(0,1,0), Enum.Material.Air
	local success = false	
	repeat
		hitPart, hitPoint, hitNormal, hitMaterial = Workspace:FindPartOnRayWithIgnoreList(castRay, blacklist, false, ignoreWater)
		if hitPart then
			local target = hitPart:FindFirstAncestorOfClass("Model")
			local targetHumanoid = target and target:FindFirstChildOfClass("Humanoid")
			if (hitPart.Transparency > 0.75
			or hitPart.Name == "Missile"
			or hitPart.Name == "Handle"
			or hitPart.Name == "Effect"
			or hitPart.Name == "Bullet"
			or hitPart.Name == "Laser"
			or string.lower(hitPart.Name) == "water"
			or hitPart.Name == "Rail"
			or hitPart.Name == "Arrow"
			or (targetHumanoid and (targetHumanoid.Health == 0 or not DamageModule.CanDamage(target, character, friendlyFire)))) then
				table.insert(blacklist, hitPart)
				success	= false
			else
				success	= true
			end
		else
			success	= true
		end
	until success
	return hitPart, hitPoint, hitNormal, hitMaterial
end
