Finding what country a player is in

Adopt me has made it so that players in areas of Asia such as North Korea and China can’t trade. Is it possible to find out what country a player is in?

This code sample gets policy information for the local player and warns if they cannot interact with paid random item generators.

I found all of this on the dev hub.

1 Like
LocalizationService:GetCountryRegionForPlayerAsync(Player)

or

PolicyService:GetPolicyInfoForPlayerAsync(Player)

Here is an example:

local PolicyService = game:GetService("PolicyService")

game.Players.PlayerAdded:Connect(function(Player)
	local PolicyInfo = PolicyService:GetPolicyInfoForPlayerAsync(Player)--returns a table
	print(PolicyInfo.ArePaidRandomItemsRestricted)
	print(PolicyInfo.IsPaidItemTradingAllowed)--I assume what adopt me checks
end)

local LocalizationService = game:GetService("LocalizationService")

game.Players.PlayerAdded:Connect(function(Player)
	local Country = LocalizationService:GetCountryRegionForPlayerAsync(Player)
	print(Country)
end)


1 Like

make sure to wrap it in a pcall

2 Likes

I’m pretty sure South Korea is the one that cant trade because people in North Korea don’t have internet or computers.

2 Likes