PromptGamePassFinished not working?

PromptGamePassFinished doesn’t seem to be working correctly for me, or maybe (most likely) I’m doing something wrong. If the player decides not to buy the gamepass and instead hits the cancel button, the character still gets unlocked.

Code:

wait(1)
local GamepassCheck = script.Parent
local GamePassID = 1234
local Player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
local Splinter = script.Parent.Parent.Selection
local SplinterTag = game.Players.LocalPlayer.Backpack:WaitForChild("SplinterTag")


GamepassCheck.MouseButton1Click:Connect(function()
	MarketplaceService:PromptGamePassPurchase(Player, GamePassID)
	end)



MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, GamePassID, wasPurchased)
	if wasPurchased then
		SplinterTag.Value = true
		Splinter.Visible = true
		Splinter.Selectable = true
		GamepassCheck.Visible = false
	else
		SplinterTag.Value = false
		Splinter.Visible = false
		Splinter.Selectable = false
		GamepassCheck.Visible = true
	end
end)
	

*GamePassID is just a random placeholder ID, but it should still work.

its better to use server for what ever this is

The script does work.
image

1 Like

This is what happens for me. (sorry for low quality, roblox videos have a bitrate of like 3)

1 Like

tbh you might be editing the wrong script or smth idk

There’s likely some other script which is causing this issue.

You are running PromptGamePassPurchaseFinished in a server script, correct?