Tutorial: Properly Validating User Input

@SteadyOn has a great module for this. It does basic rendering on the clients and sets them on the server. You can read his more in depth post here: TweenService V2 Hope this helps (:

2 Likes

EXACTLY what I’m trying to do, thank you very much!

You have most likely heard the term “don’t trust the client”. I think it is just so much safer to store all the important data on the server. If it is an intvalue or boolean etc on the server, then it should be safe. The best place on the server to store this is serverStorage, or under the script using the values in ServerScriptService. It is just too risky to store any important data on the client.

Great post! The only thing I would add is that you can have the client predict whether a purchase will be successful without waiting for the server’s response. If the client knows it has enough money, it can display the “purchase successful” message before validating the request. The server will still be in charge of authenticating the purchase and awarding the product. The only reason the client would be wrong in its prediction is if you have mismanaged state, or the player is tampering with their state using exploits. If you have mismanaged state, that’s a problem on its own that should be addressed, and if the player is exploiting, that’s their own fault that their UI is now out of sync. If you wanted too though, you could reconcile the changes made after the server authenticates the request.