Recently I’ve been testing out this LocalizationService instance. I quickly learned how to use it properly and I wanted to test it on myself, because who doens’t want?
I have a problem tho. I tried printing my country using LocalizationService:GetCountryRegionForPlayerAsync(), but it doens’t give me the correct country.
I personally live in The Netherlands, but ROBLOX thinks I am in US (USA)
Code:
local localizationService = game:GetService("LocalizationService")
game.Players.PlayerAdded:Connect(function(player)
repeat wait() until player
if player then
print(localizationService:GetCountryRegionForPlayerAsync(player))
end
end)
Screenshot of Error:
Country evidence:
Any help is highly appreciated as I think this is a bug.
Are you trying it out from Studio or In-game? I tried out a simple script in Studio and it gave that I’m form the UK, which is incorrect. But I tried it out In-Game and it correctly gave me the Country code for Malta
Yes, this is an interesting issue. I think it may well be a bug; I’ll try to replicate what you’re experiencing. Please try what @EmbatTheHybrid said though!
I’m not sure how you can do that exactly, you may probably need to have a dictionary set up with all the country codes or use an api that gives it? I’ll need to research on that
Roblox doesn’t have a Built in function for it currently
Also @synical4 the country code for the United Kingdom is GB from what the page of the function tells
I created a script that turns the ISO codes into the names of countries, but it is very long as one would expect. It is capable of printing and displaying the name and flag of a player’s country above their head once they join
game:GetService("Players").PlayerAdded:Connect(function(player)
local country = game:GetService("LocalizationService"):GetCountryRegionForPlayerAsync(player)
player.CharacterAdded:Connect(function(char)
print("Player " .. player.Name .. " joined from " .. country .. ".")
wait(5)
if country == "KP" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "North Korea"
Clone1.IconFlag.Text = "🇰🇵"
elseif country == "GB" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "United Kingdom"
Clone1.IconFlag.Text = "🇬🇧"
elseif country == "CA" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Canada"
Clone1.IconFlag.Text = "🇨🇦"
elseif country == "AF" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Afghanistan"
Clone1.IconFlag.Text = "🇦🇫"
elseif country == "AX" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Åland Islands"
Clone1.IconFlag.Text = "🇦🇽"
elseif country == "AL" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Albania"
Clone1.IconFlag.Text = "🇦🇱"
elseif country == "DZ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Algeria"
Clone1.IconFlag.Text = "🇩🇿"
elseif country == "AS" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "American Samoa"
Clone1.IconFlag.Text = "🇦🇸"
elseif country == "AD" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Andorra"
Clone1.IconFlag.Text = "🇦🇩"
elseif country == "AO" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Angola"
Clone1.IconFlag.Text = "🇦🇴"
elseif country == "AI" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Anguilla"
Clone1.IconFlag.Text = "🇦🇮"
elseif country == "AQ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Antarctica"
Clone1.IconFlag.Text = "🇦🇶"
elseif country == "AG" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Antigua and Barbuda"
Clone1.IconFlag.Text = "🇦🇬"
elseif country == "AR" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Argentina"
Clone1.IconFlag.Text = "🇦🇷"
elseif country == "AM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Armenia"
Clone1.IconFlag.Text = "🇦🇲"
elseif country == "AW" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Aruba"
Clone1.IconFlag.Text = "🇦🇼"
elseif country == "AU" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Australia"
Clone1.IconFlag.Text = "🇦🇺"
elseif country == "AT" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Austria"
Clone1.IconFlag.Text = "🇦🇹"
elseif country == "AZ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Azerbaijan"
Clone1.IconFlag.Text = "🇦🇿"
elseif country == "BS" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "The Bahamas"
Clone1.IconFlag.Text = "🇧🇸"
elseif country == "BH" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Bahrain"
Clone1.IconFlag.Text = "🇧🇭"
elseif country == "BD" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Bangladesh"
Clone1.IconFlag.Text = "🇧🇩"
elseif country == "BB" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Barbados"
Clone1.IconFlag.Text = "🇧🇧"
elseif country == "BY" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Belarus"
Clone1.IconFlag.Text = "🇧🇾"
elseif country == "BE" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Belgium"
Clone1.IconFlag.Text = "🇧🇪"
elseif country == "BZ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Belize"
Clone1.IconFlag.Text = "🇧🇿"
elseif country == "BJ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Benin"
Clone1.IconFlag.Text = "🇧🇯"
elseif country == "BM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Bermuda"
Clone1.IconFlag.Text = "🇧🇲"
elseif country == "BT" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Bhutan"
Clone1.IconFlag.Text = "🇧🇹"
elseif country == "BO" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Bolivia"
Clone1.IconFlag.Text = "🇧🇴"
elseif country == "BQ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Bonaire, Saint Eustatius and Saba"
Clone1.IconFlag.Text = "🇧🇶"
elseif country == "BA" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Bosnia and Herzegovina"
Clone1.IconFlag.Text = "🇧🇦"
elseif country == "BW" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Botswana"
Clone1.IconFlag.Text = "🇧🇼"
elseif country == "BV" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Bouvet Island"
Clone1.IconFlag.Text = "🇧🇻"
elseif country == "BR" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Brazil"
Clone1.IconFlag.Text = "🇧🇷"
elseif country == "IO" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "British Indian Ocean Territory"
Clone1.IconFlag.Text = "🇮🇴"
elseif country == "BN" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Brunei"
Clone1.IconFlag.Text = "🇧🇳"
elseif country == "BG" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Bulgaria"
Clone1.IconFlag.Text = "🇧🇬"
elseif country == "BF" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Burkina Faso"
Clone1.IconFlag.Text = "🇧🇫"
elseif country == "BI" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Burundi"
Clone1.IconFlag.Text = "🇧🇮"
elseif country == "KH" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Cambodia"
Clone1.IconFlag.Text = "🇰🇭"
elseif country == "CM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Cameroon"
Clone1.IconFlag.Text = "🇨🇲"
elseif country == "CV" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Cabo Verde"
Clone1.IconFlag.Text = "🇨🇻"
elseif country == "KY" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Cayman Islands"
Clone1.IconFlag.Text = "🇰🇾"
elseif country == "CF" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Central African Republic"
Clone1.IconFlag.Text = "🇨🇫"
elseif country == "TD" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Chad"
Clone1.IconFlag.Text = "🇹🇩"
elseif country == "CL" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Chile"
Clone1.IconFlag.Text = "🇨🇱"
elseif country == "CN" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "China"
Clone1.IconFlag.Text = "🇨🇳"
elseif country == "CX" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Christmas Island"
Clone1.IconFlag.Text = "🇨🇽"
elseif country == "CC" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Cocos (Keeling) Islands"
Clone1.IconFlag.Text = "🇨🇨"
elseif country == "CO" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Colombia"
Clone1.IconFlag.Text = "🇨🇴"
elseif country == "KM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Comoros"
Clone1.IconFlag.Text = "🇰🇲"
elseif country == "CG" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Republic of the Congo"
Clone1.IconFlag.Text = "🇨🇬"
elseif country == "CD" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Democratic Republic of the Congo"
Clone1.IconFlag.Text = "🇨🇩"
elseif country == "CK" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Cook Islands"
Clone1.IconFlag.Text = "🇨🇰"
elseif country == "CR" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Costa Rica"
Clone1.IconFlag.Text = "🇨🇷"
elseif country == "CI" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Côte d’Ivoire"
Clone1.IconFlag.Text = "🇨🇮"
elseif country == "HR" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Croatia"
Clone1.IconFlag.Text = "🇭🇷"
elseif country == "CW" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Curaçao"
Clone1.IconFlag.Text = "🇨🇼"
elseif country == "CY" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Cyprus"
Clone1.IconFlag.Text = "🇨🇾"
elseif country == "CZ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Czechia"
Clone1.IconFlag.Text = "🇨🇿"
elseif country == "DK" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Denmark"
Clone1.IconFlag.Text = "🇩🇰"
elseif country == "DJ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Djibouti"
Clone1.IconFlag.Text = "🇩🇯"
elseif country == "DM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Dominica"
Clone1.IconFlag.Text = "🇩🇲"
elseif country == "DO" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Dominican Republic"
Clone1.IconFlag.Text = "🇩🇴"
elseif country == "EC" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Ecuador"
Clone1.IconFlag.Text = "🇪🇨"
elseif country == "EG" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Egypt"
Clone1.IconFlag.Text = "🇪🇬"
elseif country == "SV" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "El Salvador"
Clone1.IconFlag.Text = "🇸🇻"
elseif country == "GQ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Equatorial Guinea"
Clone1.IconFlag.Text = "🇬🇶"
elseif country == "ER" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Eritrea"
Clone1.IconFlag.Text = "🇪🇷"
elseif country == "EE" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Estonia"
Clone1.IconFlag.Text = "🇪🇪"
elseif country == "ET" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Ethiopia"
Clone1.IconFlag.Text = "🇪🇹"
elseif country == "FK" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Falkland Islands"
Clone1.IconFlag.Text = "🇫🇰"
elseif country == "FO" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Faroe Islands"
Clone1.IconFlag.Text = "🇫🇴"
elseif country == "FJ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Fiji"
Clone1.IconFlag.Text = "🇫🇯"
elseif country == "FI" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Finland"
Clone1.IconFlag.Text = "🇫🇮"
elseif country == "FR" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "France"
Clone1.IconFlag.Text = "🇫🇷"
elseif country == "GF" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "French Guiana"
Clone1.IconFlag.Text = "🇬🇫"
elseif country == "PF" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "French Polynesia"
Clone1.IconFlag.Text = "🇵🇫"
elseif country == "TF" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "French Southern Territories"
Clone1.IconFlag.Text = "🇹🇫"
elseif country == "GA" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Gabon"
Clone1.IconFlag.Text = "🇬🇦"
elseif country == "GM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "The Gambia"
Clone1.IconFlag.Text = "🇬🇲"
elseif country == "GE" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Georgia"
Clone1.IconFlag.Text = "🇬🇪"
elseif country == "DE" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Germany"
Clone1.IconFlag.Text = "🇩🇪"
elseif country == "GH" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Ghana"
Clone1.IconFlag.Text = "🇬🇭"
elseif country == "GI" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Gibraltar"
Clone1.IconFlag.Text = "🇬🇮"
elseif country == "GR" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Greece"
Clone1.IconFlag.Text = "🇬🇷"
elseif country == "GL" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Greenland"
Clone1.IconFlag.Text = "🇬🇱"
elseif country == "GD" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Grenada"
Clone1.IconFlag.Text = "🇬🇩"
elseif country == "GP" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Guadeloupe"
Clone1.IconFlag.Text = "🇬🇵"
elseif country == "GU" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Guam"
Clone1.IconFlag.Text = "🇬🇺"
elseif country == "GT" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Guatemala"
Clone1.IconFlag.Text = "🇬🇹"
elseif country == "GG" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Guernsey"
Clone1.IconFlag.Text = "🇬🇬"
elseif country == "GN" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Guinea"
Clone1.IconFlag.Text = "🇬🇳"
elseif country == "GW" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Guinea-Bissau"
Clone1.IconFlag.Text = "🇬🇼"
elseif country == "GY" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Guyana"
Clone1.IconFlag.Text = "🇬🇾"
elseif country == "HT" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Haiti"
Clone1.IconFlag.Text = "🇭🇹"
elseif country == "HM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Heard Island and the McDonald Islands"
Clone1.IconFlag.Text = "🇭🇲"
elseif country == "VA" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Vatican City"
Clone1.IconFlag.Text = "🇻🇦"
elseif country == "HN" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Honduras"
Clone1.IconFlag.Text = "🇭🇳"
elseif country == "HK" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Hong Kong"
Clone1.IconFlag.Text = "🇭🇰"
elseif country == "HU" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Hungary"
Clone1.IconFlag.Text = "🇭🇺"
elseif country == "IS" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Iceland"
Clone1.IconFlag.Text = "🇮🇸"
elseif country == "IN" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "India"
Clone1.IconFlag.Text = "🇮🇳"
elseif country == "ID" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Indonesia"
Clone1.IconFlag.Text = "🇮🇩"
elseif country == "IQ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Iraq"
Clone1.IconFlag.Text = "🇮🇶"
elseif country == "IE" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Ireland"
Clone1.IconFlag.Text = "🇮🇪"
elseif country == "IM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Isle of Man"
Clone1.IconFlag.Text = "🇮🇲"
elseif country == "IL" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Israel"
Clone1.IconFlag.Text = "🇮🇱"
elseif country == "IT" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Italy"
Clone1.IconFlag.Text = "🇮🇹"
elseif country == "JM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Jamaica"
Clone1.IconFlag.Text = "🇯🇲"
elseif country == "JP" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Japan"
Clone1.IconFlag.Text = "🇯🇵"
elseif country == "JE" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Jersey"
Clone1.IconFlag.Text = "🇯🇪"
elseif country == "JO" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Jordan"
Clone1.IconFlag.Text = "🇯🇴"
elseif country == "KZ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Kazakhstan"
Clone1.IconFlag.Text = "🇰🇿"
elseif country == "KE" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Kenya"
Clone1.IconFlag.Text = "🇰🇪"
elseif country == "KI" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Kiribati"
Clone1.IconFlag.Text = "🇰🇮"
elseif country == "KR" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "South Korea"
Clone1.IconFlag.Text = "🇰🇷"
elseif country == "KW" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Kuwait"
Clone1.IconFlag.Text = "🇰🇼"
elseif country == "KG" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Kyrgyzstan"
Clone1.IconFlag.Text = "🇰🇬"
elseif country == "LA" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Laos"
Clone1.IconFlag.Text = "🇱🇦"
elseif country == "LV" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Latvia"
Clone1.IconFlag.Text = "🇱🇻"
elseif country == "LB" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Lebanon"
Clone1.IconFlag.Text = "🇱🇧"
elseif country == "LS" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Lesotho"
Clone1.IconFlag.Text = "🇱🇸"
elseif country == "LR" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Liberia"
Clone1.IconFlag.Text = "🇱🇷"
elseif country == "LY" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Libya"
Clone1.IconFlag.Text = "🇱🇾"
elseif country == "LI" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Liechtenstein"
Clone1.IconFlag.Text = "🇱🇮"
elseif country == "LT" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Lithuania"
Clone1.IconFlag.Text = "🇱🇹"
elseif country == "LU" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Luxembourg"
Clone1.IconFlag.Text = "🇱🇺"
elseif country == "MO" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Macao"
Clone1.IconFlag.Text = "🇲🇴"
elseif country == "MK" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "North Macedonia"
Clone1.IconFlag.Text = "🇲🇰"
elseif country == "MG" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Madagascar"
Clone1.IconFlag.Text = "🇲🇬"
elseif country == "MW" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Malawi"
Clone1.IconFlag.Text = "🇲🇼"
elseif country == "MY" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Malaysia"
Clone1.IconFlag.Text = "🇲🇾"
elseif country == "MV" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Maldives"
Clone1.IconFlag.Text = "🇲🇻"
elseif country == "ML" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Mali"
Clone1.IconFlag.Text = "🇲🇱"
elseif country == "MT" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Malta"
Clone1.IconFlag.Text = "🇲🇹"
elseif country == "MH" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Marshall Islands"
Clone1.IconFlag.Text = "🇲🇭"
elseif country == "MQ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Martinique"
Clone1.IconFlag.Text = "🇲🇶"
elseif country == "MR" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Mauritania"
Clone1.IconFlag.Text = "🇲🇷"
elseif country == "MU" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Mauritius"
Clone1.IconFlag.Text = "🇲🇺"
elseif country == "YT" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Mayotte"
Clone1.IconFlag.Text = "🇾🇹"
elseif country == "MX" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Mexico"
Clone1.IconFlag.Text = "🇲🇽"
elseif country == "FM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Micronesia"
Clone1.IconFlag.Text = "🇫🇲"
elseif country == "MD" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Moldova"
Clone1.IconFlag.Text = "🇲🇩"
elseif country == "MC" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Monaco"
Clone1.IconFlag.Text = "🇲🇨"
elseif country == "MN" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Mongolia"
Clone1.IconFlag.Text = "🇲🇳"
elseif country == "ME" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Montenegro"
Clone1.IconFlag.Text = "🇲🇪"
elseif country == "MS" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Montserrat"
Clone1.IconFlag.Text = "🇲🇸"
elseif country == "MA" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Morocco"
Clone1.IconFlag.Text = "🇲🇦"
elseif country == "MZ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Mozambique"
Clone1.IconFlag.Text = "🇲🇿"
elseif country == "MM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Myanmar"
Clone1.IconFlag.Text = "🇲🇲"
elseif country == "NA" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Namibia"
Clone1.IconFlag.Text = "🇳🇦"
elseif country == "NR" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Nauru"
Clone1.IconFlag.Text = "🇳🇷"
elseif country == "NP" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Nepal"
Clone1.IconFlag.Text = "🇳🇵"
elseif country == "NL" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Netherlands"
Clone1.IconFlag.Text = "🇳🇱"
elseif country == "AN" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Netherlands Antilles"
Clone1.IconFlag.Text = "🇦🇳"
elseif country == "NC" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "New Caledonia"
Clone1.IconFlag.Text = "🇳🇨"
elseif country == "NZ" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "New Zealand"
Clone1.IconFlag.Text = "🇳🇿"
elseif country == "NI" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Nicaragua"
Clone1.IconFlag.Text = "🇳🇮"
elseif country == "NG" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Nigeria"
Clone1.IconFlag.Text = "🇳🇬"
elseif country == "NU" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Niue"
Clone1.IconFlag.Text = "🇳🇺"
elseif country == "NF" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Norfolk Island"
Clone1.IconFlag.Text = "🇳🇫"
elseif country == "MP" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Northern Mariana Islands"
Clone1.IconFlag.Text = "🇲🇵"
elseif country == "NO" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Norway"
Clone1.IconFlag.Text = "🇳🇴"
elseif country == "OM" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Oman"
Clone1.IconFlag.Text = "🇴🇲"
elseif country == "PK" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Pakistan"
Clone1.IconFlag.Text = "🇵🇰"
elseif country == "PW" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Palau"
Clone1.IconFlag.Text = "🇵🇼"
elseif country == "PS" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Palestine"
Clone1.IconFlag.Text = "🇵🇸"
elseif country == "PA" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Panama"
Clone1.IconFlag.Text = "🇵🇦"
elseif country == "PG" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Papua New Guinea"
Clone1.IconFlag.Text = "🇵🇬"
elseif country == "PY" then
local Clone1 = Gui:Clone()
Clone1.Parent = char.Head
Clone1.PlrCountry.Text = "Paraguay"
Clone1.IconFlag.Text = "🇵🇾"
A better option would be to just index a dictionary like this with a code, for instance:
local LocalizationService = game:GetService("LocalizationService")
local FlagLookup = require(path)
local ok, result = pcall(LocalizationService.GetCountryRegionForPlayerAsync, SomePlayer)
if ok then
local flag = FlagLookup[result].Emoji
sometext.Text = flag
end
Actually while testing the server you use is a local server on your computer, which is in NL. I bet they grab your language settings while in studio due to not being in a proper server.