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)