Can you see if a player owns a gamepass with a plugin?

Basically I want to be able to tell if the player who is using a certain plugin(That I created)
owns a certain gamepass. Any way to do this? Thanks!

1 Like

StudioService will help you find the ID of the user and MarketplaceService fetch the info.

local Toolbar = plugin:CreateToolbar("Top Secret")
local MarketplaceService = game:GetService("MarketplaceService")
local StudioService = game:GetService("StudioService") -- plugin security

local USERID = StudioService:GetUserId()
local GAMEPASSID = 0000

if USERID == 0 then
	warn("Top Secret Plugin: Unknown UserId.")
end

local success, result = pcall(function()
	return MarketplaceService:UserOwnsGamePassAsync(USERID, GAMEPASSID)
end)

if success then
	print(result)
end
2 Likes

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