Hitting

How do I keep my daughter from hitting people. I’m so tired of being slapped in the face but spatting her hand when she hits isn’t helping. I don’t think she’s doing it to be mean either, she thinks it’s a funny game. But I’m tired of spanking her when that’s obviously not working.