I am attempting to make a double jump system for my game but i dont want to have it be client based as that would make it easier to exploit but if I make it server based there is a lag between the space bar being pushed and the player jumping. I am wondering how games with double jump get around this while also keeping it secure . Sorry if this is in the wrong topic I couldnt think of anywhere else to put it. Sorry if i should be in a different place.
I don’t think you really can secure a double jump system. If an exploiter wants to go higher than normal, they can just teleport wherever they want. Exploiters have full control of their own characters, unless you implement some complicated Humanoid replacement complete with server-side authority and such. In my opinion, you should just keep it client-sided to keep a lag-free experience, since there’s not much you can do in terms of exploiters.
Plenty can be done, a anti double jumping script can cause lag as its based on the players input and quickly changes it to allow them to jump again.
You could log their position with each jump to make sure it goes down after though, it might be a lot better lag wise. I wouldnt advice checking for humanoid.jump and because to catch people doing that you would need quite a fast loop which could easily create lag.
You can use the Humanoid.Jump property, the Humanoid.Jumping event or Enum.HumanoidStateType.Jumping to detect this from the server, without needing to fire remote events or detecting input from the client.