Print all players country's

I am currently trying to make a script that will print everyones country into the F9 console when you click a textbutton as the league I run has a big issue with people using VPN’s and this should cut down on some of it and also lying about country of origin.

I don’t know why you’d have to print every players country and would actually recommend not to, however, that’s how you’d approach it:

Turns out my approach didn’t work at all.

So you’ll first use localization services and get the local players country, and send it to the server and add it to a table.

A VPN will still mask a player’s country. There is no way to bypass the effects of a VPN, nor do I see a reason for which you’d need to bypass it.

Before reading further, note that printing all players’ countries of origin in console or anywhere else without user’s consent is a violation of privacy. You cannot do that. However, you can likely use this data for statistics and translation.
Disclaimer: I am not a lawyer and this is not a legal advice. What I’m telling has an informative nature. I don’t guarantee that what I said is completely right.

How do you print countries? Use LocalizationService. You can loop through all players on the server and method :GetCountryRegionForPlayerAsync() will return country codes, for example, United States to US.

local Players = game:GetService("Players");
local LocalizationService = game:GetService("LocalizationService")

for i, player in pairs(Players:GetPlayer()) do
	print(LocalizationService:GetCountryRegionForPlayerAsync(player))
end
1 Like