[WARNING]:
This library is now deprecated, use the following library instead:
CountryService (Country data Module) - Resources / Community Resources - Developer Forum | Roblox
Hi guys, I came here to show this library that took me a way too long to make. Essentially what it does is grab on the code of a country and return a decal of its flag/name. All flags have been manually uploaded by me and have a similar aspect ratio (tried to keep them as close to each other as possible).
This can be used to develop country leaderboards, displayers and or basically anything that is country related.
Here’s an example on how to use it:
--[[
This is a local script inside of the player scripts
]]
--Services||
local LocalizationService = game:GetService("LocalizationService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
----------||
--Dependencies||
local countries = require(ReplicatedStorage:WaitForChild("ProoCountry"))
--------------||
--Variables||
local player = game.Players.LocalPlayer
-----------||
--Methods||
local result, code = pcall(function()
--Get the country code
return LocalizationService:GetCountryRegionForPlayerAsync(player)
end)
if result and code ~= nil then
--Get the information about this count (both name and flag)
local countryData = countries.getCountry(code)
print(countryData)
else
warn("Couldn't proccess players country")
end
---------||
Example:
Links:
example place (copy unlocked): Flag API - Roblox
code (github): GitHub - prooheckcp/ProoCountry: A small library that returns both the country name/flag from the code