It's a LocalScript that checks if a player has bought a gamepass and then gives him gear, It doesn't give the player gear and nothing is showing up in the Output. Here's my code.
local passId = 529594138 --change this to your GamePass Id
local marketplaceService = game:GetService("MarketplaceService")
local gearpro = game.ReplicatedStorage:WaitForChild('ProAssaultRifle')
local newgearpro = gearpro:Clone()
marketplaceService.PromptPurchaseFinished:connect(function(player,assetId,isPurchased)
if isPurchased then --if the player did pay
if assetId == passId then --if what they bought is the pass
newgearpro.Parent = player.Backpack
newgearpro.Parent = player.StarterPack
print(player.Name .. " bought the pass (" .. passId .. ")")
end
end
end)

1 comment
Are they buying the gamepass before they join the game, or as they are playing the game? If it is as they are playing the game, I don't think that PromptPurchaseFinished works as intended in a LocalScript.