How do you Prevent Copies from appearing inside a Table?


I was Wondering: How do I prevent Copies from Appearing in a Table?

To Explain Better, lets say i add an Item to a Table after buying it from a shop, but the Item already is in the table, if the Item is already existing inside the table, how do I Replace or Remove it, or at least prevent people from buying it again?

you mean like

if not table.find(tbl, item) then
    --can buy
1 Like

Yep, That’s Pretty Much it, Thanks, But one more thing:
(Ignore this Bottom Part if you like, Just some extra details you might already know or have seen in another Topic of mine), Help is Appreciated tho.

Slightly Off Topic:
I’m trying to create a Shop with DataStoreService (You might know this if you saw my other Topics. I never got any good replies, if any at all),The only issue is that i cant figure out how to save Items in a Table, or BoolValue, nor determine if it has been purchased or not. I dont want to use DataStore2 or ProfileService since:

  1. I Dont Exactly Trust them (Mainly since they are ModuleScripts)

  2. I Perfer DataStoreService

Help if you want with this part, you don’t have to as its not directly related to the Topic.

Original Topic Here

If you set the value of a key that was already added it will be overwritten.

DataStore2 and ProfileService both use DataStoreService.

1 Like