I made a post similar to this one but I guess I didn’t really explain it that well. I’m trying to make a purchasing system where an item can be purchased multiple times. However every time the player buys the item the price increases by a certain amount. I’m having trouble figuring out what part should be client sided and what should be server sided because the price is different for each client depending on how many times they’ve already upgraded.
You would have the GUI (Assuming you are using a GUI based shop) on the client. Once the player hits ‘buy’, a remote event fires to the server alerting the server that said player wants to buy the item. There can be an IntValue under the player’s Player object (in game.Players) which represents the price for that player (or even better, the number of times they have bought the item, and the new price can be calculated by some function of x, for example: f(x, y) = x ^ y where x represents the original price, and y represents the number of times bought). The server either responds to the client with another firing of the event saying the product cannot be afforded (or you could use a RemoteFunction instead of a RemoteEvent), or just buys the item for the player. I hope this makes sense and helps you out
The client should only handle the GUI and user input. Exploiters can do whatever they want with their client, such as firing a RemoteEvent as much as they want, with any values passed. The rule that I always follow when scripting is: If server can do this, then server should do this.