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.

4 comments
I'm not seeing the problem, are there any errors with the code? Try printing multiple lines and possibly some variables and information being used by the script to help narrow down your problem.
No errors at all which is incredibly strange, I will put a print around each line or so and see what I get
Very odd, I just tried it now and it worked. HOWEVER, I exited and joined and bought the devproduct again...and it doesn't work....there seems to be something going on, is it lag?
Interesting, when it actually worked, I noticed that the prints from the script were running but when it isn't "working" none of the script's print would appear. Maybe I have too many scritps in the game? I am going to add some waits() to them