I'm trying to make a ROBLOX lottery and I need to know when the player buys an asset (Developer product) and It doesn't print anything. FE is on and it's in a serverscript in Workspace. The problem is no output, except for the purchase prompt. Here's the code.
local productId = 31191997
game.Players.PlayerAdded:connect(function(player)
game:GetService("MarketplaceService").PromptPurchaseFinished:connect(function(player, assetId, isPurchased)
if isPurchased then
print(player.Name .. " bought an item with AssetID: " .. assetId)
else
print(player.Name .. " didn't buy an item with AssetID: " .. assetId)
end
end)
game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)
