What would be the best way to secure my shop?

Hi, I have a shop inside of my game and different skins have different rarities. Each rarity has a set amount of price, for example common 100, uncommon 200, rare 300 etc. I have all of the skins in Folders that names are the different rarities. I store how much each rarity is priced at in a module script and whenever a player selects a different skin it changes a value in StarterGui to the weapon name they selected.

How could I securely pass over the weapon rarity to the server? If I were to have a StringValue in StarterGui that stores the weapons rarity and pass that over to the server it would be easily exploited by just changing the value and then a legendary skin could be the price of a common skin. I thought about having an array stored in a ModuleScript that stores all the skins and rarites of those skins but that may not be as efficient. So what would be the best way to secure the skins rarities without them being exploited?

You can store the module script in which all the prices of rarities are set in Replicated Storage, that way even if the client changes the values in there (Because of Filtering Enabled Client Changes Don’t replicate to whole server), your Server script which handles the Remote Events will reduce the Price of that item from player’s Money by looking at the Replicated Storage module, which won’t change for it.

Yes, but I’m asking how would I pass over the skins rarity over to the server, not the price of the rarity of the skin.

Edit: If a player edits a name of a folder in ReplicatedStorage will that change for the server?

You will probably need a module in which you store all the skin’s rarities, and you will need the player to pass the Skin name over to the server and then check that skin’s rarity and do the stuff.

Also if a player edits the folder name in ReplicatedStorage it won’t change for the Server