Skip to content

Service · inherits Instance

PolicyService

Official docs ↗

Helps you query information regarding policy compliance for players around the world based on age range, location, and platform type.

About PolicyService

PolicyService helps you query information regarding policy compliance for players around the world based on age range, location, and platform type.

Methods 2

  • CanViewBrandProjectAsync(player: Player, brandProjectId: string) → booleanYieldsDetermines if a user can see brand project assets inside your experience.

    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.

  • GetPolicyInfoForPlayerAsync(player: Instance) → DictionaryYieldsReturns policy information about a player based on geolocation, age group, and platform.

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

    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:

    See also LocalizationService.GetCountryRegionForPlayerAsync which returns a country/region code string according to the player's client IP geolocation.

PolicyService also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.