Basically, i tryed to make a cashgrab game because all my “efforts” game ended up failling all by all, so i attempted making this genre of products that trigers op actions for cheap prices.
However, when i attempted to call the purchase nothing happened and no error messages were meet.
game.MarketplaceService.ProcessReceipt = function(process)
if process.PurchaseId == 2816614444 then
for _, player in game.Players:GetPlayers() do
if player.Character and player.Character:FindFirstChildOfClass("Humanoid") then
player.Character.Humanoid.Health = 0
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
PurchaseId is a unique ID for each transaction (I think), while ProductId identifies the ID of the purchased product
This code should work:
game.MarketplaceService.ProcessReceipt = function(process)
if process.ProductId == 2816614444 then
for _, player in game.Players:GetPlayers() do
if player.Character and player.Character:FindFirstChildOfClass("Humanoid") then
player.Character.Humanoid.Health = 0
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end