local Remote = workspace:WaitForChild("BuyGamePet")
local ID = 7039978
game.Players.PlayerAdded:Connect(function(plr)
Remote.onServerEvent:Connect(function()
game:GetService("MarketplaceService").PromptGamePassPurchase:Connect(function(plr, ID)
end)
end)
end)
Error: ServerScriptService.PetGamePass:6: attempt to index field 'PromptGamePassPurchase' (a function value)

2 comments
Do I also need to use PromptGamePassPurchaseFinished to finish the transaction?
If you want to do something when they buy