So I've gotten several messages that in my game that sometimes the developer products aren't working. Is there something wrong with my script?!?
wait() local MarketplaceService = game:GetService("MarketplaceService") local character1, character2, character3, slotid, subs1250, subs100, views25000, views5000 = 42907443, 46692064, 46536644, 45098689, 45145715, 45145621, 45160253, 45160240 local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") print("online") MarketplaceService.ProcessReceipt = function(receiptInfo) print("somthing has spawned") local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.ProductId if PurchaseHistory:GetAsync(playerProductKey) then return Enum.ProductPurchaseDecision.PurchaseGranted end for i, player in ipairs(game.Players:GetPlayers()) do if player.userId == receiptInfo.PlayerId then print(receiptInfo.ProductId) if receiptInfo.ProductId == character1 then print("1 wurks") player.skins[player.PlayerGui.GUI.main_menu.character_select.buy_skins.skin1.Value].Value = 1 elseif receiptInfo.ProductId == character2 then print("hey u should haz it") player.skins[player.PlayerGui.GUI.main_menu.character_select.buy_skins.skin2.Value].Value = 1 elseif receiptInfo.ProductId == character3 then print("3 werks") player.skins[player.PlayerGui.GUI.main_menu.character_select.buy_skins.skin3.Value].Value = 1 elseif receiptInfo.ProductId == slotid then player.data.slots.Value = player.data.slots.Value + 1 elseif receiptInfo.ProductId == subs1250 then player.leaderstats.Subscribers.Value = player.leaderstats.Subscribers.Value + 1250 elseif receiptInfo.ProductId == subs100 then player.leaderstats.Subscribers.Value = player.leaderstats.Subscribers.Value + 100 elseif receiptInfo.ProductId == views25000 then player.leaderstats.Views.Value = player.leaderstats.Views.Value + 25000 elseif receiptInfo.ProductId == views5000 then player.leaderstats.Views.Value = player.leaderstats.Views.Value + 5000 else print("idk fam") end end end PurchaseHistory:SetAsync(playerProductKey, true) return Enum.ProductPurchaseDecision.PurchaseGranted end
Change it to PurchaseId for 'playerProductKey'. Otherwise everyone can buy something only once. As the things you use to validate it will always remain the same, it's not a unique identification.