You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want my Developer Products to work when I or somebody else buy them. -
What is the issue? Include screenshots / videos if possible!
Nothing will happen after purchasing it. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I added a print to the script and when I bought the developer product it didn’t print.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local MarketplaceService = game:GetService("MarketplaceService")
local SS = game:GetService("SoundService")
local Products = {
-- NOTE I HAVE THE PRODUCT ID INSERTED IN THE BRACKETS, JUST DIDN'T PUT IN SCRIPT.
[0]=function(receipt,player)--give currency
player.leaderstats.Points.Value = player.leaderstats.Points.Value +math.floor(player.leaderstats.Points.Value*.2+100)
end;
}
function MarketplaceService.ProcessReceipt(receiptinfo)
local playerProductKey = receiptinfo.PlayerId..":"..receiptinfo.PurchaseId
local plr = game:GetService("Players"):GetPlayerByUserId(receiptinfo.PlayerId)
local handler
for ProductId,func in pairs(Products) do
if ProductId == receiptinfo.ProductId then
handler = func break
end
end
local suc = pcall(handler,receiptinfo,plr)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Can you guys help me? By the way no errors when I buy it.