I am trying to make my developer product only be able to be bought by a person once. The tutorials on the wiki are pretty terrible for this topic in my opinion and I don't understand at all. I am trying to use a datastore that stores the different developer products and if they have been bought:
local datastore = game:GetService("DataStoreService"):GetDataStore("GameStore")
game.Players.PlayerAdded:connect(function(player)
local key = "user-" .. player.userId
local storeditems = datastore:GetAsync(key)
if storeditems then
Yum = storeditems[1]
else
local items = {Yum}
datastore:SetAsync(key, items)
end
end)
game.Players.PlayerRemoving:connect(function(player)
local items = {Yum}
local key = "user-" .. player.userId
datastore:SetAsync(key, items)
end)
I understand datastores and such, but I have no clue on how to use developer products. Any help?
