Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to prevent item duping? [closed]

Asked by 4 years ago

I’m trying to script trading in my game but I’m concerned about item duping where a malicious player disconnects right after the trade and logs back in with items that were supposed to be traded as well as items obtained from the trade. I know this has been a problem in games even outside of roblox and am interested in hearing how developers would go about tackling this. Here are some of my ideas that may or may not work, in order of complexity.

  1. Wait a few seconds before loading player datastores upon playeradded. This would delay GetAsync
  2. Delete items that are being traded from datastores of both players, then add them back after some interval. During that interval if a player dc’s or leaves then they will just lose the items to discourage duping.
  3. Instead of deleting and adding items, morph the items to become the traded items. Since no items are being added, duping shouldn’t even be possible?
  4. Delete traded items from datastores then generate two GUIDs, one for each player. These are only generated once the server knows that the datastores no longer have the items. The GUIDs are stored for a brief moment and reference a list of items that were traded. Both clients request the server by giving it the IDs. If the IDs are only ever generated when items are deleted, the trade couldn’t result in a dupe?

I would appreciate any ideas or comments about this topic.

Closed as Primarily Opinion-Based by User#23252

This question has been closed because it is a discussion about a topic focused on diverse opinions, which isn't a good fit for our Q&A format.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

when the 2 players agree to trade, delete and save the traded items from the respective players.. don't make frequent Datastore calls, just simply save the items that should be put in datastore some other way, then when the player is leaving, or your doing a periodic datastore saving session you save the data in datastore.. this method fast and will allow you to process the trade faster than a player can dupe, Datastore calls are very expensive, and can easily fail if "overcalled".

Ad