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

If player has GamePass put into table?

Title says most of it, if a player has a gamepass how would I put it into a table?

Sorry there's not much code but not sure what to do..

Table:

VIPs = {}

In the end I hope to do this:

function CheckVIPs(name)
	for i = 1, #VIPs do
		if VIPs[i] == name then
			return true;
		end 
	end
	return false;
end

1 answer

You need to use market place service, for this script it is very simple, basically like admin.

local VIPs = {}

local passId = 0000000 -- change this to your game pass ID.
 
function isAuthenticated(player) -- checks to see if the player owns your pass
    return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end
 
game.Players.PlayerAdded:connect(function(plr)
    if isAuthenticated(plr) then
        table.insert(VIPs, plr)
    end
end)

If you need any more help, go to this wiki page:

http://wiki.roblox.com/index.php?title=Game_pass

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