Help with sprint script

I hope i chose the right topic for this but i have a question when i make a sprint script should i change the walkspeed on client or server because people have told me both on client it poses security risks but no delay but on server its secure but theres delay

1 Like

I would mix in both.

Things the client/player does to their character will always replicate to the server, so if the exploiter changes their walkspeed on the client, the server wont register the walkspeed change, but will validate the players position, effectively still allowing for increased speed. For a sprint script, I would use a RemoteEvent to fire an event to the server to activate sprinting, and register keystrokes on the client.

You definitely need to implement sanity checks so players dont go above the threshold, thats why anti-cheat exists.

yes, that is true, that you should not trust the client.
But as you are making a sprint script, there is no worry for delay.
Delay is only an issue for fast moving things and more advanced projects that involve for example raycasting, where the delay actually matters.

But for a sprint script, it doesn’t pose a big issue.

so just listen for key input then fire to server and change speed?

Yep, listen for input on the client, and change walkspeed on the server.
Though add sanity checks so unexpected behaviour doesn’t slip pass.

If you need help, come back, and ill try to help you.

1 Like