PromptPurchaseFinished problem

Hello, im having problem making a script to show gamepass prompt, and disable an UI once its done successfully. But when I test it, the PromptPurchaseFinished never even runs. The print isnt runned. How can I fix?

if Marketplace:UserOwnsGamePassAsync(game.Players.LocalPlayer.UserId, AssetId) then
	script.Parent.TextButton.Visible = false
	script.Parent.Bought.Visible = true
end


script.Parent.ImageLabel.Image = "rbxassetid://"..PassInfo

script.Parent.TextButton.MouseButton1Click:Connect(function()
	Marketplace:PromptGamePassPurchase(game.Players.LocalPlayer, AssetId)
	task.wait()
	Marketplace.PromptPurchaseFinished:Connect(function(player, pass_id, was_purchased)
		print(was_purchased, pass_id, player)
	if was_purchased == true then
	script.Parent.TextButton.Visible = false
	script.Parent.Bought.Visible = true	
	end
	end)
	
end)

PromptPurchaseFinished does not run for gamepasses, use PromptGamepassFinished instead

1 Like

Instead of using PromptPurchaseFinished you should be using PromptGamePassPurchaseFinished, since you prompted the player with PromptGamePassPurchase instead of PromptPurchase

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.