Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
PolicyService
Inherits from: Instance → Object
PolicyService helps you query information regarding policy compliance for players around the world based on age range, location, and platform type.
Inherits from: Instance
Memory category: Instances
Tags: NotCreatable, Service, NotReplicated
Methods
| Name | Type / Returns | Description |
|---|---|---|
| PolicyService:CanViewBrandProjectAsync | boolean | Determines if a user can see brand project assets inside your experience. |
| PolicyService:GetPolicyInfoForPlayerAsync | Dictionary | Returns policy information about a player based on geolocation, age group, and platform. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance:AddTag | () | Applies a tag to the instance. |
| Instance:children | Instances | Returns an array of the object's children. |
| Instance:ClearAllChildren | () | This method destroys all of an instance's children. |
| Instance:Clone | Instance | Create a copy of an instance and all its descendants, ignoring instances that are not Archivable. |
| Instance:clone | Instance | |
| Instance:Destroy | () | Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children. |
| Instance:destroy | () | |
| Instance:FindFirstAncestor | Instance? | Returns the first ancestor of the Instance whose Instance.Name is equal to the given name. |
| Instance:FindFirstAncestorOfClass | Instance? | Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className. |
| Instance:FindFirstAncestorWhichIsA | Instance? | Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstChild | Instance? | Returns the first child of the Instance found with the given name. |
| Instance:findFirstChild | Instance | |
| Instance:FindFirstChildOfClass | Instance? | Returns the first child of the Instance whose ClassName is equal to the given class name. |
| Instance:FindFirstChildWhichIsA | Instance? | Returns the first child of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstDescendant | Instance? | Returns the first descendant found with the given Instance.Name. |
| Instance:GetActor | Actor? | Returns the Actor associated with the Instance, if any. |
| Instance:GetAttribute | Variant | Returns the value which has been assigned to the given attribute name. |
| Instance:GetAttributeChangedSignal | RBXScriptSignal | Returns an event that fires when the given attribute changes. |
| Instance:GetAttributes | Dictionary | Returns a dictionary of the instance's attributes. |
| Instance:GetChildren | Instances | Returns an array containing all of the instance's children. |
| Instance:getChildren | Instances | |
| Instance:GetDebugId | string | Returns a coded string of the debug ID used internally by Roblox. |
| Instance:GetDescendants | Instances | Returns an array containing all of the descendants of the instance. |
| Instance:GetFullName | string | Returns a string describing the instance's ancestry. |
| Instance:GetStyled | Variant | Returns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified. |
| Instance:GetStyledPropertyChangedSignal | RBXScriptSignal | Returns an event that fires when the given style property changes on the instance. |
| Instance:GetTags | Array | Gets an array of all tags applied to the instance. |
| Instance:HasTag | boolean | Check whether the instance has a given tag. |
| Instance:IsAncestorOf | boolean | Returns true if an Instance is an ancestor of the given descendant. |
| Instance:IsDescendantOf | boolean | Returns true if an Instance is a descendant of the given ancestor. |
| Instance:isDescendantOf | boolean | |
| Instance:IsPropertyModified | boolean | Returns true if the value stored in the specified property is not equal to the code-instantiated default. |
| Instance:QueryDescendants | Instances | Returns an array containing all descendants of the instance that match the selector string. |
| Instance:Remove | () | Sets the object's Parent to nil, and does the same for all its descendants. |
| Instance:remove | () | |
| Instance:RemoveTag | () | Removes a tag from the instance. |
| Instance:ResetPropertyToDefault | () | Resets a property to its default value. |
| Instance:SetAttribute | () | Sets the attribute with the given name to the given value. |
| Instance:WaitForChild | Instance | Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object:GetPropertyChangedSignal | RBXScriptSignal | Get an event that fires when a given property of the object changes. |
| Object:IsA | boolean | Returns true if an object's class matches or inherits from a given class. |
| Object:isA | boolean |
PolicyService:CanViewBrandProjectAsync
Determines if a user can see brand project assets inside your experience. This method lets you work with brands to only show commercial assets to brand-compliant audiences.
To use CanViewBrandProjectAsync, you must use a brand project ID provided by Roblox. To request a brand project ID, contact us.
You must call this method on a server-side Script and wrap it in a LuaGlobals.pcall().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| player | Player | The Player object you're trying to show the brand project to. | |
| brandProjectId | string | The brand project ID provided by Roblox. Represents all assets associated with a brand project. |
Returns
| Type | Description |
|---|---|
| boolean | Whether or not the brand project can be shown to the specific user. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Basic"] |
Code samples: View on Creator Hub (PolicyService-BrandProjectIntegrationServer, PolicyService-BrandProjectIntegrationClient).
PolicyService:GetPolicyInfoForPlayerAsync
Returns policy information about a player based on geolocation, age group, and platform. The structure of the returned dictionary is as follows:
| Name | Type | Required for | Description |
|---|---|---|---|
AreAdsAllowed | Boolean | Any experience that includes immersive ads. | When true, the player might see immersive ads within an experience. |
ArePaidRandomItemsRestricted | Boolean | Any experience that has paid random items. | When true, the player can not interact with paid random item generators, either via in‑experience currency bought with Robux or Robux directly. |
IsContentSharingAllowed | Boolean | Any feature in the experience that enables users to create content (e.g. text, images, video, audio) that other users can see in the experience or allows user to share content within experiences. | When true, the player can use features related to sharing UGC within an experience, such as uploading a screen capture, sharing a video, or posting an image to a content feed that other users can see. |
IsEligibleToPurchaseCommerceProduct | Boolean | Any experience that wants to sell commerce products. | When true, the player is eligible to purchase commerce products within an experience. |
IsEligibleToPurchaseSubscription | Boolean | Any experience that wants to sell subscriptions. | When true, the player is eligible to purchase subscriptions within an experience. |
IsPaidItemTradingAllowed | Boolean | Any experience that allows users to purchase virtual items that they can trade with other players. | When true, the player can trade virtual items that they purchased with in-experience currency or Robux. |
IsPhotoToAvatarAllowed | Boolean | Any experience that uses the Photo-to-Avatar APIs. | When true, the player is permitted by policy to use the Photo-to-Avatar API [`AvatarCreationService:PromptSelectAvatarGenerationImageAsync()`](/docs/avatarcreationservice#avatarcreationservice-promptselectavatargenerationimageasync). This flag reflects age (for example, users under 13) and regional restrictions, which are evaluated server-side. Check it before calling Photo-to-Avatar APIs to avoid policy-related errors. Note that a true value does not by itself guarantee the prompt will succeed: camera and photo-library availability is checked separately on the player's device, so calls can still fail on platforms where camera access is unavailable. |
IsSubjectToChinaPolicies | Boolean | Any experience that is available in China. | When true, an experience should enforce compliance changes. See this forum post for more information. |
AllowedExternalLinkReferences | Array | Not required. | This is a legacy field. It always returns an empty array. |
IsEndlessContentLoadAllowed | Boolean | Any experience that includes a feature where content loads automatically and endlessly as the user scrolls, such as a feed, providing an endless flow of media content without requiring the user to engage in any specific interaction such as manual "load more" actions or separate pagination. | When true, the player can use features with endless content loading within an experience. |
IsEndlessContentAutoplayAllowed | Boolean | Any experience that contains media content (video or audio) that automatically and endlessly plays without requiring user interaction or initiation, for example clicking a play button. | When true, the player can use features within an experience that automatically and endlessly play media content. |
Exceptions
Like any async call, this method needs to be wrapped in LuaGlobals.pcall() and error-handled properly. A full list of possible error messages and their reasons is:
| Message | Reason |
|---|---|
| Instance was not a player | The player parameter is not a Class.Player instance. |
| Players not found | Internal error that the Class.Players object is missing. |
| This method cannot be called on the client for a non-local player | This method cannot be called on the client for a non-local Class.Player. |
| GetPolicyInfoForPlayerAsync is called too many times | Internal error that GetPolicyInfoForPlayerAsync() is called more than 100 (current setting) times before an HTTP response comes back. |
See also LocalizationService:GetCountryRegionForPlayerAsync() which returns a country/region code string according to the player's client IP geolocation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| player | Instance | The Player to get policy information for. |
Returns
| Type | Description |
|---|---|
| Dictionary | A dictionary containing information about the policy information of the requested player; see above for the dictionary structure. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Basic"] |
Code samples: View on Creator Hub (getting-policy-information-for-a-player, getting-policy-for-a-player-for-commerce-products).
Properties
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.Archivable | boolean | Determines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published. |
| Instance.archivable | boolean | |
| Instance.Capabilities | SecurityCapabilities | The set of capabilities allowed to be used for scripts inside this container. |
| Instance.IsInSandbox | boolean | Indicates whether the instance is inside a sandboxed container. |
| Instance.Name | string | A non-unique identifier of the Instance. |
| Instance.Parent | Instance | Determines the hierarchical parent of the Instance. |
| Instance.PredictionMode | PredictionMode | Reflects the client-side prediction mode applied to the instance under server-authoritative physics. |
| Instance.RobloxLocked | boolean | A deprecated property that used to protect CoreGui objects. |
| Instance.Sandboxed | boolean | When enabled, the instance can only access abilities in its Capabilities list. |
| Instance.UniqueId | UniqueId | A unique identifier for the instance. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.ClassName | string | A read-only string representing the class this Object belongs to. |
| Object.className | string |
Events
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.AncestryChanged | Fires when the Instance.Parent property of this object or one of its ancestors is changed. | |
| Instance.AttributeChanged | Fires whenever an attribute is changed on the Instance. | |
| Instance.ChildAdded | Fires after an object is parented to this Instance. | |
| Instance.childAdded | ||
| Instance.ChildRemoved | Fires after a child is removed from this Instance. | |
| Instance.DescendantAdded | Fires after a descendant is added to the Instance. | |
| Instance.DescendantRemoving | Fires immediately before a descendant of the Instance is removed. | |
| Instance.Destroying | Fires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy(). | |
| Instance.StyledPropertiesChanged | Fires whenever any style property is changed on the instance, including when a property is set to nil. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.Changed | Fires immediately after a property of the object changes, with some limitations. |