Devproduct purchases must be handled through the ProcessReceipt callback and not through an event, so I highly recommend reading this api page very carefully
Here is a simple snippet of code I made a while ago:
local function processReceipt(receiptInfo)
local player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
giveRandomGun(player, true)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketplaceService.ProcessReceipt = processReceipt