✓ Accepted answer
The best and only way of securing information sent by the client is by undergoing checks and tests to determine whether the action that the client is trying to take is valid.
If, for example, you were giving a player an item, you would give the player the item from a server script and save the information in a data store. Then, if they equipped that item through a gui, to prevent exploiters from sending any item name over to equip, you would check if the item that they are attempting to equip is in their datastore before equipping it.
The checks you need really depends on what you are trying to do. If you were doing a cookie clicker game, where the player clicked a cookie gui for different amounts of points, you would check on the server if they were authorised to gain that amount of points each click. For example, if there were different upgrades to give different amounts of cookies each click, the server would add up all the upgrades that the player has and check if the amount of points they are trying to get is less than the total amount that they are able to get with their upgrades. If it’s not, you dont give them the cookies.
The basics are that you keep an outline of all the player’s information on the server and compare it with data sent from the client to see if they have the authority to do something. You can specify your exact problem if you still need help, and I’ll do my best to answer.
1 comment
You should not save data in a remote event / function. At all times the server must be in control over when and how you save data.