Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to check if someone bough the gamepass?

2 answers

You will have to check whether the gamepass /product own is true so you could do something like this

local hasPass = false
 
	-- Check if the player already owns the game pass
	local success, message = pcall(function()
		hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
	end)
local market = game:GetService("MarketplaceService")
local plr = game:GetService("Players").LocalPlayer
local gamepass = 0 --change to your gamepass ID

if market:PlayerOwnsAssest(plr, gamepass) then 
	--put in the script where the player owns it
else
	game:GetService("MarketplaceService"):PromptPurchase(game.Players.LocalPlayer, gamepass)
end 

This discussion is preserved as it was. New answers, comments, and votes are closed.