local MarketplaceService = game:GetService("MarketplaceService") 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)
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.