A private server is a subscription-based feature that allows a player to decide who can play a game with them. While private servers can be free, you can also use private servers as a method of monetization by charging players who want to access private servers a monthly Robux fee.
Private servers offer players privacy in circumstances like:
- Playing games with friends.
- Holding gatherings such as classes, meetings, or parties.
- Recording and/or streaming without other players.
- Gathering in-game resources.
Enable private servers
Before you can enable private servers, your game must be public.
To create a private server:
Navigate to the game's main page on the Creator Dashboard.
In the left-hand navigation, expand Audience and then click Advanced Settings.
In the Private Servers section, toggle on Allow private servers. Additional settings appear for setting how to monetize private servers:
- Enable Requires Robux and enter the amount of Robux you want players to pay to access private servers. The price you enter affects the amount of Robux you earn per sale.
- Disable Requires Robux to make private servers free to all.
Click the Save Changes button.
Prompt players to set up a private server in-game
Players often want a private server while they're already playing, such as when they want to join friends or get their own space. MarketplaceService:PromptVIPServerPurchase() lets you prompt a player to set up and join a private server without leaving your game. You decide when to show the prompt, such as from a button in a lobby or after a round ends.
To add the prompt to your game:
- Enable private servers for your game.
- Add a button or other trigger in your game.
- From a LocalScript or Script, call MarketplaceService:PromptVIPServerPurchase() and pass in the target player.
The following example calls the prompt from a LocalScript when a player clicks a button:
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local buyButton = script.Parent.BuyPrivateServerButton
buyButton.Activated:Connect(function()
local success, errorMessage = pcall(function()
MarketplaceService:PromptVIPServerPurchase(localPlayer)
end)
if not success then
warn("Failed to open private server purchase prompt:", errorMessage)
end
end)Every existing way of joining a private server still works alongside the prompt.