Gamepass purchasing and checking with updating

So i want to make if player .TriggerEnded a proximityprompt and if player doesnt have a gamepass then it will prompt and check until the player purchases it
and NO i dont need it to update after the player rejoins and i dont know how do i do that

If I understand well, it should works.
Just uncheck “Enable” of the proximity prompt.

local GamePassID = 'put the ID of the gamepass'
local MarketService = game:GetService("MarketplaceService")
local proxPrompt = script.Parent.ProximityPrompt

game.Players.PlayerAdded:Connect(function(Plr)
	local PlayerHasGamePass = MarketService:UserOwnsGamePassAsync(Plr.UserId, GamePassID)
	if PlayerHasGamePass == true then
		proxPrompt.Enabled = true
		
	elseif PlayerHasGamePass == false then
		proxPrompt.Enabled = false
	end 
end)

bruh-
what did i just said
i want that update when the player just purchased it

So you want to make it in realtime ?

yeah

OMG THE BYPASS IS CRAZY

Can you try this one :

local MarketplaceService = game:GetService("MarketplaceService")

local passID = 0000000  -- Change this to your Pass ID

-- Function to handle a completed prompt and purchase
local function onPromptPurchaseFinished(player, purchasedPassID, purchaseSuccess)
	if purchaseSuccess and purchasedPassID == passID then
		print(player.Name .. " purchased the Pass with ID " .. passID)
		script.Parent.ProximityPrompt.Enabled = true
	end
end

-- Connect "PromptGamePassPurchaseFinished" events to the function
MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptPurchaseFinished)

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