This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
Returns policy information about a player which is based on geolocation, age group, and platform. The structure of the returned dictionary is as follows:
|ArePaidRandomItemsRestricted||Boolean||Whether the player can interact with paid random item generators.|
|IsSubjectToChinaPolicies||Boolean||See here for details.|
|AllowedExternalLinkReferences||Array of strings||Which external link references are allowed in a country/region.|
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:
|Instance was not a player||Dev's usage - The parameter is not a Player instance|
|Players not found||Internal error - Players object missing|
|This method cannot be called on the client for a non-local player||Dev's usage - This method cannot be called on the client for a non-local player|
|GetPolicyInfoForPlayerAsync is called too many times||Internal error - GetPolicyInfoForPlayerAsync is called more than 100(current setting) times before http response coming back|
LocalizationService/GetCountryRegionForPlayerAsync, returns country/region code string according to player’s client IP geolocation
The Player that you are getting policy information for
A dictionary containing information about the policy information of a given player
Getting Policy Information for a Player
This code sample gets policy information for the local player and warns if they cannot interact with paid random item generators.