How do I prevent ghost hits with hitboxes

What’s the best way to go about preventing ghost hits, what I mean by this is for example a combat script, I have a very common issue of the client playing the VFX thinking its a hit but its actually not a hit on the server, it’s very unreliable, Perhaps I’m doing it wrong I’m not sure.

If anyone has any topics or tutorials that will help me with this please provide them, I am in great need of them.

(Currently I create a hitbox on the client, if it detects a player it plays the vfx, then I create a hitbox on the server, if it detects a player I damage them)