Stamina System server side or client side?

I have tried to research to see which one is better, but I couldn’t find a proper answer

I am trying to make a stamina system for using skills and sprint, so I wonder which side is better for it ? Server-Side or Client-Side

I will really appreciate it if you can also explain the reason

1 Like

always server sided, much safer as hackers cannot set their stamina to full

Client side with server side checks

1 Like

I’d make it client sided, but before executing anything have the server run a check.
This is because UserInputService generally runs smoother and is easier to work with on the client.
However, cheaters can modify any code on the client, so running a server sided check before actually executing something is usually a lot safer.

Both are good ways, but it’s up to you.

Here’s the difference between them

Client-Side

Good side:

  • It’s useful and is what a lot of people use for their staminas.
  • Less network traffic as you access directly on the client(game.UserInputService)
  • No delay when you try to sprint

Bad side:

  • Hackers can change the stamina, since it’s on the client.

Server-side

Good side:

  • Hackers cannot change their stamina rate or even how much stamina left they have, since they can only do so in the client, not the server.

Bad side:

  • If there’s a sudden rise of ping, the stamina may delay of response. Also, it is a “hacky” way to get more stamina as you have more time to run than intended
  • Too many requests to actually detect if the player wants to sprint, especially via a RemoteEvent when you detect what key the player pressed which will cause network traffic and can risk of rise in everyone’s ping intensly(eg. from 30ms to 93000ms)
1 Like

alr thanks, I guess I will go with client one

I wonder how do I check it, like I need to send data to the server ?

You can probably check if the stamina’s value isn’t doing its job right(eg. stamina value changed from 18% to 100% immediately)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.