“If you love me, keep my commands. And I will ask the Father, and he will give you another advocate to help you and be with you forever—
John 14:15-16 NIV
Andrew Murray points out, in his book Experiencing The Holy Spirit, that obedience is key to receiving the fullness of the Holy Spirit. In fact, Jesus refers to this more than once and Peter mentions it:
We are witnesses of these things, and so is the Holy Spirit, whom God has given to those who obey him.” -Acts 5:32 NIV