I'm making a shop which sells gems, you click a button on a GUI and it does pop up with the prompt to buy the Dev Product. My issue is that on the server the script for the management of the Dev Product is not working
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo)
print("purchase")
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.PurchaseId == 1138648796 then
if player then
local PlayerData = Data:get(player)
PlayerData.Gems += 1000
remotes.Update:FireClient(player)
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
if receiptInfo.PurchaseId == 1138648972 then
if player then
local PlayerData = Data:get(player)
PlayerData.Gems += 2500
remotes.Update:FireClient(player)
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
