1 | local MarketplaceService = game:GetService( "MarketplaceService" ) |
2 |
3 | MarketplaceService.PromptPurchaseFinished:Connect( function (player, assetId, isPurchased) |
4 | if isPurchased then |
5 | print (player.Name .. " bought an item with AssetID: " .. assetId) |
6 | else |
7 | print (player.Name .. " didn't buy an item with AssetID: " .. assetId) |
8 | end |
9 | end ) |
I have this code in a script in serverscriptstorage but it wont print anything for some reason
It probably won't print anything because it's in ServerStorage. Put it somewhere else like ServerScriptStorage. Also, in the code that you gave, you did not prompt a player the gamepass. I'm pretty new to MarketPlaceService, so I might be wrong.