Yea can some one plz teach me how to do it?...
local MarketplaceService = game:GetService("MarketplaceService") local Money = YOURID local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") MarketplaceService.ProcessReceipt = function(receiptInfo) local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId if PurchaseHistory:GetAsync(playerProductKey) then return Enum.ProductPurchaseDecision.PurchaseGranted --We already granted it. end -- find the player based on the PlayerId in receiptInfo local player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId) if not player then -- Seems like we can't find the player... already left? return Enum.ProductPurchaseDecision.NotProcessedYet -- Can't process end if receiptInfo.ProductId == Money then -- handle purchase. In this case we are healing the player. player.Data.SafeGold.Value = player.Data.SafeGold.Value + 0 player.Data.Gold.Value = player.Data.Gold.Value + 0 end -- record the transaction in a Data Store PurchaseHistory:SetAsync(playerProductKey, true) -- tell ROBLOX that we have successfully handled the transaction (required) return Enum.ProductPurchaseDecision.PurchaseGranted end
Closed as Not Constructive by M39a9am3R
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?