I got really scared but after I found a PolicyService did that. I wrote some small script but the output is country code and not country name itself. I’ll put code here:
local LocalizationService = game:GetService("LocalizationService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local result, code = pcall(LocalizationService.GetCountryRegionForPlayerAsync, LocalizationService, player)
if result then
print("You are from "..code)
end
i think you mentioned my game. I used https://restcountries.com/ so i can change the country code into country name itself. i also used HttpService to use this api. ill post a nice snippet so you can learn/use it.
local LocalizationService = game:GetService("LocalizationService")
local plr = game:GetService("Players").PlayerAdded:Wait()
local HttpService = game:GetService("HttpService")
local result, code = pcall(LocalizationService.GetCountryRegionForPlayerAsync, LocalizationService, plr)
local url = "https://restcountries.com/v3.1/alpha/"..code
local response = HttpService:GetAsync(url)
local data = HttpService:JSONDecode(response)
if result then
wait(5)
print(data[1].name.common)
end
make sure to enable HttpEnabled (you can use this to enable it game:GetService("HttpService").HttpEnabled = true)
(also this is my first devforum post)