Shop Item security

Hi,

I am building a GUI shop for players to buy items but having issues deciding on the best place to store the items to make them secure from hacking.

I was thinking of replicated storage?

Thanks

Maybe in ServerStorage and, to take it, it would be with a RemoteEvent, but it is still insecure.

As long as the clients wouldn’t need to see the tool objects themselves (or whatever you are storing) the ideal system would be like this:

  • Store all of your tools in ServerStorage under a folder
  • Have a ModuleScript reference in ReplicatedStorage of all of your game’s items (what they cost, images, title, description, anything)
  • Clients fire a remote that asks if they can purchase an item
  • The server checks if that item is valid and, in fact, part of the item list in ReplicatedStorage and if the player can afford it (I recommend using string indexes to make this part better)
  • Clone the corresponding tool from ServerStorage in your folder and add it to the player’s backpack
3 Likes

Replicated storage is the best to store remote event and if u want ur event to be secured, then
when using the RemoteEvent.OnServerEvent:connect(function(plr, ---whaterver u put here) script u actually remove the coins here and add the tool to the player inventory. which mean if exploiter fires the RemoteEvent then they are actually buying it and they cant even edit the script.

1 Like

It is the safest if you combine it with the answer from @Crystalflxme.

1 Like

yea but what is safe is doing everything in the script when the remote is fired. the other like store tool, module script are optional

The module would be so that the customer knows what is in the store, so it could avoid “(object): not found”.

1 Like