Hello!
First, this may be the wrong category but this seems to be the better one for this type of questions.
I am making a game and I have a little staff with a few administrators. My game will probably have a paid access (either for early access or permanent paid access). I am wondering if there is a way to “whitelist” a player for a free version: so the player whitelisted has “free access” to the game (Administrators) and players not whitelisted have the paid access. The game I am talking about is a player’s game, not a group game.
Thank you!
Well the game is my game, meaning that this is not owned by a group but by me (player).
But yes I have a group. You mean creating a game pass to have access to the game ?
As far as I am concerned, it is currently impossible to allow specific players to play the game for free. You will just have to provide those people with the Robux to buy the game.
--server script
-- changeable values
local groupId = nil-- enter your group id here
local groupRole = ''-- enter your group role for players that can play for free
local gamePassId = nil-- enter your game pass id for player that needs to pay
local ownerUserId = nil -- enter your UserId
-- other values
local MarketplaceService = game:GetService("MarketplaceService")
-- if player gets the game pass promt handle it
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player,gamePassId_,wasPurchased)
-- checks if the player bought the right game pass
if wasPurchased and gamePassId_ == gamePassId then
return -- player can play because he bought the right game pass
else
player:Kick('you did not buy the game pass')
end
end)
-- this checks if the player has the group role for players that can play for free
game.Players.PlayerAdded:Connect(function(player)
-- gets the role of the new player and compares it
local role = player:GetRoleInGroup(groupId)
if role == groupId or player.UserId == ownerUserId then
return -- player can play for free
else
-- player needs game pass
-- gets if the player has the game pass
local success , hassPass = pcall(function()
return MarketplaceService:UserOwnsGamePassAsync(player.UserId,gamePassId)
end)
if success then
if hassPass then
return -- player can play because he hass the game pass
else
-- asks the player
MarketplaceService:PromptGamePassPurchase(player,gamePassId)
end
else-- kicks the player because of an error
player:Kick('we had an error please rejoin')
end
end
end)
Is your method about a gamepass access to the game (I think) (Like, the game is free, but the access requires a gamepass) ? If it is, it can be a good way but people would, like @PrismaticShadows, think about a “scam” or a game that is either locked or closed access, so a good part of players wouldn’t join, even if this is written in the kick message that the user needs to buy a gamepass.
Click Game Settings (In HOME tab), Then navigate to permissions.
Scroll down, and add ‘Collaborators’. and change user’s permission to Edit, you can enable access for that user without robux. (NOTE: This method also enables access to studio, whitch means you can’t give Edit access to random strangers like giveaways. Play permission does NOT work.)