NameTag with Country Flags

I made a simple nametag with flags.
Captura de tela 2023-03-10 160506
Model: NameTag - Roblox
Converter:

local function getFlag(player)
	local code = LocalizationService:GetCountryRegionForPlayerAsync(player)
	local first = string.byte(string.upper(string.sub(code, 1, 1))) - 0x41 + 0x1F1E6
	local second = string.byte(string.upper(string.sub(code, 2, 2))) - 0x41 + 0x1F1E6
	return utf8.char(first) .. utf8.char(second)
end

--getFlag(player)
12 Likes

Very thanks @toto1230kl! You are really smart! I like it!

2 Likes

uuhhh this is a smart usage by getting flags :slight_smile:

2 Likes

its just me or it does not work with unverified players?

It should work with any player

1 Like

yeah but when I join with alt accounts apparently neither nametag nor flag loads. At this point there is an issue in my game i guess. Also, I have seen that sometimes flags are only visible for the player himself, while the others see a blue loading sign.
(Anyways cool system)

Nice model! It works, however there’s a problem, I don’t know if it’s from me or not, but it says that I’m from the US, but I’m not…