Hit.parent issue

part.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid") then
       local hrp = hit.Parent:FindFirstChild("HumanoidRootPart") or hit.Parent.Parent:FindFirstChild("HumanoidRootPart")
       hrp.Transparency = 0.5
    end
end)