Okay guys I will try to be quick and organized.
I have one LocalScript in a GUI that consists of this
wait(0.1) local player = game.Players.LocalPlayer local currency = player:WaitForChild('leaderstats').Coins local devid = IDHERE --Give # of coins Open = false itembutton.MouseButton1Click:connect(function() game:GetService('MarketplaceService'):PromptProductPurchase(game.Players.LocalPlayer, devid) end)
and then I have another script in ServerScriptService as such
MarketplaceService = game:GetService("MarketplaceService") local devid = IDHERE MarketplaceService.ProcessReceipt = function(receiptInfo) for i, v in pairs(game.Players:GetChildren()) do if v.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == devid then v.leaderstats.Coins.Value = v.leaderstats.Coins.Value + 100 local DataStore = game:GetService("DataStoreService") local ds1 = DataStore:GetDataStore("coins") ds1:SetAsync(v.UserId, v.leaderstats.Coins.Value) wait() end end end return Enum.ProductPurchaseDecision.PurchaseGranted end
The problem is that I am not getting the plus 100 coins that I should be getting upon buying the devproduct id. The LocalScript works fine, it shows the devproduct and I can purchase it, but then after that I do not get my 100 coins. Why exactly is this? Could you give me any ideas? I have tried resetting the character, still nothing.
I'm sorry I cant give you a good explanation here, however I had the EXACT same problem you did...
I used this link to solve it: ProcessReceipt
If that still doesn't work for you then try this: Handling Multiple Developer Products
Once again I apologise for not being able to explain anything but I hope I've helped in some way.