So,
I’ve made a Hunger system for my game that works with attributes on set the player.
It works with a loop that repeats every HungerUpdateTime.
Every time the loop repats, a HungerValue is decreased by one. The player dies when the HungerValue reaches 0.
Now, these attribute changes are handled through a ServerScript because I’ve read on multiple topics that exploiters are able to modify anything that runs on the client, thus, I’m afraid they might change the HungerUpdateTime to something ridiculously high, like for example, 99999 seconds. If they achieve this, the hunger wouldn’t change at all for them.
Now,
my current system works fine but I’m worried it might cause server lag since it runs on the server for ALL the players at the same time.
I want:
Some guidance on how to make server scripts more optimized since my game will run mostly on these. I only plan on using LocalScripts for stuff like the GUI, etc…