function FpsCamera.IsValidPartToModify(A,p)if p:FindFirstAncestorOfClass("\084\111\111\108")then return false end if p:IsA("\068\101\099\097\108")then p=p.Parent end if p and p:IsA("\066\097\115\101\080\097\114\116")then local l=p:FindFirstAncestorWhichIsA("\065\099\099\111\117\116\114\101\109\101\110\116")if l then if p.Name~="\072\097\110\100\108\101"then local A=l:FindFirstChild("\072\097\110\100\108\101",true)if A and A:IsA("\066\097\115\101\080\097\114\116")then p=A end end for p,l in pairs(p:GetChildren())do if l:IsA("\065\116\116\097\099\104\109\101\110\116")then if A.HeadAttachments[l.Name]then return true end end end elseif p.Name=="\072\101\097\100"then local A=p.Parent local l=workspace.CurrentCamera local G=A and A:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")if G and l.CameraSubject==G then return true end end end return false end
-- This is an overload function for TransparencyController:IsValidPartToModify(part)
-- You may call it directly if you'd like, as it does not have any external dependencies.

function FpsCamera:IsValidPartToModify(part)
	if part:FindFirstAncestorOfClass("Tool") then
		return false
	end

	if part:IsA("Decal") then
		part = part.Parent
	end

	if part and part:IsA("BasePart") then
		local accessory = part:FindFirstAncestorWhichIsA("Accoutrement")

		if accessory then
			if part.Name ~= "Handle" then
				local handle = accessory:FindFirstChild("Handle", true)

				if handle and handle:IsA("BasePart") then
					part = handle
				end
			end

			for _, child in pairs(part:GetChildren()) do
				if child:IsA("Attachment") then
					if self.HeadAttachments[child.Name] then
						return true
					end
				end
			end
		elseif part.Name == "Head" then
			local model = part.Parent
			local camera = workspace.CurrentCamera
			local humanoid = model and model:FindFirstChildOfClass("Humanoid")

			if humanoid and camera.CameraSubject == humanoid then
				return true
			end
		end
	end

	return false
end
