InvokeClient alternative?

Hi! I am currently trying to make a hitbox system which currently works great but from what I’ve read, it’s not very reliable if the client has high ping or experiences lag(spikes).

I have tried using invokeclient() from a server script in order to get humanoidrootpart cframe and position it, to get player-friendly combat experience.


From what I’ve read, if the player runs into ping/lag issues then the client will respond with a delay, which will give the laggy person an advantage to other players by delaying their hitbox timing with their animation timing.

I have also tried getting humanoidrootpart cframe info from server script alone. From what I have noticed, it tends to delay the hitbox position from the client’s character position, which could ruin the player’s combat experience.


This method should be more reliable from the other method since whenever the player lags, it still shouldn’t delay the hitbox timing.

Now the actual reason for my post: Is there an InvokeClient alternative? I really wanna have my hitbox system be reliable in both it’s client positioning & timing no matter if the player has high ping or experiences lag spikes.

From what I know it’s pretty much impossible to do this, as in any way you will always be experiencing delay, not even info can be instantaneous (even though it moves at 1,079999e+12 meters per hour)

you can try to “weld” the hitbox in the player

1 Like

And then get the position of the hit box? It wouldn’t work from what I know, as still it would take time to move the hitbox

Isn’t there a method I can try using on a server script in order to make the hitbox at least more solid to the player?

what i mean is to attach the hitbox like an hat you have but it’s an invisible hitbox

I don’t know anything about that, but maybe what @ARandomGuy_WasTkn could be a kind of solution, as it might work most of the time, but form what I know if you have lag slimes and those things it’s almost impossible to get were exactly the Player would be

But it would still have delay, as the Server is still getting the position of the Player, so it could work half

the player position that is laggy is impossible for us to fix

That’s exactly what he’s trying to fix

then he can do player movement prediction, but that is complex and can be bugged

So I discussed this earliuer on a similar thread. Essentially the problem is not with just roblox but with all FPS shooters. If you invoke the client to return the cframe of the player you are waiting for the player to get the information and send it back which depending on ping can range greatly.

Yes, so there’s no answer/solution to what he wants, it’s literally impossible, as the speed of light alone is 300’000 km/s, which is still a time

NO, i’m dumb and all, but i think this would let cheaters change the hitbox position where he want and reduce it

1 Like

Exactly, as from what I know they have complete control over it? Not sur ethi

1 Like

You could fire two instances of the raycast one on the server one on the client if the two do not both hit the target return false. That would be about as good as it could get. You could even see if the players mouse is hovering a target and request that targets client cframe and fire raycasy to and from to confirm further. You would get 3 solutions you could check to see if all 3 return true to get a successful hit.

yeah but LAGG

This text will be blurred

1 Like

Yes but it still doesn’t work with lag, if there’s lag it will return false and kick the player

Also @BoyMexy, there’s no way of doing this, sorry…

i think we can conclude with: there will always be some player teleporting every 2 secs because of lag, but we can optimize the game

1 Like

Raycasts are not that bad on lag only but it is a performance tradeoff. And no Dede I wasnt saying kick the player lol. im telling you how games like call of duty handle these issues themselves.

I didn’t know about that but still, if there’s lag it wouldn’t matter, it doesn’t work