--ABprice
--Ref
local MessagingService = game:GetService("MessagingService")
local KillAllProductId = 1573117560
local RevengeProductID = 1584502433
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(info)
local ProductID = info.ProductId
if KillAllProductId == ProductID then
MessagingService:PublishAsync("KILLED_ALL",info.PlayerId)
elseif ProductID == RevengeProductID then
MessagingService:PublishAsync("REVENGE",info.PlayerId)
end
end
You are not returning a ProductPurchaseDecisionEnum, returning nothing tells roblox that the purchase still has not been fulfilled. (Roblox will retry incomplete purchases)
It is also recommended to wrap network calls in pcalls as they can error
local MessagingService = game:GetService("MessagingService")
local KillAllProductId = 1573117560
local RevengeProductID = 1584502433
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(info)
local ProductID = info.ProductId
local Success, Error
if KillAllProductId == ProductID then
Success, Error = pcall(MessagingService.PublishAsync, MessagingService, "KILLED_ALL", info.PlayerId)
elseif ProductID == RevengeProductID then
Success, Error = pcall(MessagingService.PublishAsync, MessagingService, "REVENGE", info.PlayerId)
end
if not Success then
warn(Error)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
If you return NotProcessedYet, roblox will retry once they purchase again or rejoin. If the purchase is not completed in 3 days, roblox will automatically refund the user.
Returning PurchaseGranted tells roblox that you have fulfilled the purchase.