How to create a gamepass access game

Hello,

Recently I have wondered, is there a way to only let players who are in a whitelist in and if they are not check if they have the gamepass, is this possible or not? I saw it in the newest Firestone V3 Update. If you know please reply if you can, that would be great. Thanks

3 Likes

Ok, if you want to only give certain users access, add them to the team create with permissions set to play only.

If you want people to have to buy it to play it, turn on paid access in your settings and set the amount of robux.

I do not know if you can do both but I think anyone in the team create can play free.

1 Like

Would something like this work?

local player = Players.LocalPlayer
local hasPass = false

local success, message = pcall(function()
	hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
end)

if not success then
	warn("Error while checking if player has pass: " .. tostring(message))
	return
end

if hasPass then
	-- Player already owns the game pass; tell them somehow
else
	player:Kick(message: Get the gamepass)
end

end

2 Likes

Nope, people in the team create still have to pay for the game, regardless if they have edit access or play access.

Well, of course its possible. But the real question is: should you do it? I don’t think you should do it because it’s a great way to earn downvotes on your game since players will join and immediately get kicked.

The only way to get around this is to set it to paid access and give the devs/playtesters the Robux to buy paid access for that game.

Hope this helps!

1 Like
1 Like

I have no idea if that will work. I can’t script.

1 Like

Hmm… I could have sworn that used to work.

1 Like

You haven’t defined: gamePassID

local player = Players.LocalPlayer

local gamePassID = 1 --Put your GamepassId instead of 1
local hasPass = false

local success, message = pcall(function()
	hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
end)

if not success then
	warn("Error while checking if player has pass: " .. tostring(message))
	return
end

if hasPass then
	-- Player already owns the game pass; tell them somehow
       print("Player owns Pass!")
else
	player:Kick("Get the gamepass!")
end

Set the 1 to your GamePassId

After you defined gamePassID, go and update and check in game by using an print to see if worked and to see it use /console.
And you have tried to use Techniques of Javscript and Python.

1 Like

Thank You so much! I will be using this in the future.

And why do you not just use the Gamepass acces feature? With that you dont need an gamepass they need buy the acces and can then join.

I am very sorry but I don’t quite follow you.