PolicyService

Show Deprecated
Not Creatable
Service
Not Replicated

Important for getting your game to all audiences, PolicyService helps you build gameplay components that can be made compliant with various national regulations for multiple countries. This service is used to query information regarding policy compliance for players around the world based on age range, location, and platform type.

Summary

Properties

Events

Methods


Returns policy information about a player which is based on geolocation, age group, and platform.

Properties

IsLuobuServer

LuobuWhitelisted

Events

Methods

GetPolicyInfoForPlayerAsync

Yields

Returns policy information about a player which is based on geolocation, age group, and platform. The structure of the returned dictionary is as follows:

NameTypeRequired forDescription
AreAdsAllowedBooleanAny experience that includes immersive adsWhen true, the player might see immersive ads within an experience.
ArePaidRandomItemsRestrictedBooleanAny experience that has paid random itemsWhen true, the player cannot interact with paid (via in-experience currency or Robux) random item generators.
AllowedExternalLinkReferencesArray of stringsAny experience that references external linksA list of external link references (for example, social media links, handles, or iconography) a player is permitted to see. Possible values include: "Discord", "Facebook", "Twitch", and "YouTube".
IsPaidItemTradingAllowedBooleanAny experience that allows users to purchase virtual items that they can trade with other playersWhen true, the player can trade virtual items that they purchased with in-experience currency or Robux.
IsSubjectToChinaPoliciesBooleanAny experience that is available in ChinaWhen true, an experience should enforce compliance changes. See this developer forum post for more information.

Exceptions

Like any async call, this needs to be wrapped in a pcall and error-handled properly. A full list of possible error messages and their reasons is as below:

MessageReason
Instance was not a playerDev's usage - The parameter is not a Player instance
Players not foundInternal error - Players object missing
This method cannot be called on the client for a non-local playerDev's usage - This method cannot be called on the client for a non-local player
GetPolicyInfoForPlayerAsync is called too many timesInternal error - GetPolicyInfoForPlayerAsync is called more than 100(current setting) times before http response coming back

See also:

Parameters

player: Instance

The Player that you are getting policy information for.


Returns

A dictionary containing information about the policy information of a given player.

Code Samples

Getting Policy Information for a Player

1local PolicyService = game:GetService("PolicyService")
2local Players = game:GetService("Players")
3
4local player = Players.LocalPlayer
5
6local success, result = pcall(function()
7 return PolicyService:GetPolicyInfoForPlayerAsync(player)
8end)
9
10if not success then
11 warn("PolicyService error: " .. result)
12elseif result.ArePaidRandomItemsRestricted then
13 warn("Player cannot interact with paid random item generators")
14end

GetPolicyInfoForServerRobloxOnlyAsync

Yields
Roblox Script Security

Returns