Too early for discipline...?

My 9 month old has been hitting me in the face lately as well as pulling my hair.

I do say no or stop firmly and then say gentle and run their hand on me gentle. But when I say no or stop the laugh and smile and continue doing it.

I don’t know how to handle the situation really.

I don’t want them growing up thinking hitting anyone is ok. And I want them to respect what I say.

I don’t know if they understand when I say no or if they’re still too little.