Hey! So I’m trying to create a thing in my game, where when someone purchases the developer product (in-game) it gives them snowballs in return. My code right now is:
local id = DEVELOPERPRODUCTID
local tool = workspace.ServerStorage
local MarketplaceService = game:GetService("MarketplaceService")
game:GetService("MarketplaceService"):PromptProductPurchase(plr, id)
MarketplaceService.PromptProductPurchaseFinished:Connect(function(userId, productId, value)
if userId == plr.UserId and id == productId and value then
tool.Parent = player:WaitForChild("Backpack")
return true
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end)
end)```
Does anyone know if this would work?
I think, although I don’t understand what value is. (value in this line MarketplaceService.PromptProductPurchaseFinished:Connect(function(userId, productId, value))
You should be using ProcessReceipt as PromptProductPurchaseFinished is depreciated. You can prompt the purchase from the server or the client, but verify the purchases on the server.