Skip to main content

Country

Contains the data for each country of this library. It is used to retrieve information such as a decal, emoji and name of a country to display it to the user.

local CountryService = require(ReplicatedStorage.CountryService)

local country: CountryService.Country = CountryService:GetMyCountry()

--Set the UI
local screenGui: ScreenGui = playerGui:WaitForChild("Country") :: ScreenGui
local container: Frame = screenGui:WaitForChild("Container") :: Frame

local countryFlag: ImageLabel = container:WaitForChild("CountryFlag") :: ImageLabel
local countryInfo: TextLabel = container:WaitForChild("CountryInfo") :: TextLabel

countryFlag.Image = country.decal
countryInfo.Text = `Hi! Welcome from {country.name} {country.emoji}`

Properties

Code

Country.Code: string

The code of the country e.g US

Name

Country.Name: string

Contains the name of the country e.g US = "United States"

Emoji

Country.Emoji: string

Contains the emoji of the country e.g US = 🇺🇸

Decal

Country.Decal: string

Contains the flag of the emoji, it can be used for ImageLabels, Decals and ImageButtons!

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new instance of a country\n\nE.g\n```lua\nlocal Portugal = Country.new()\nPortugal.name = \"Portugal\"\nPortugal.emoji = \"🇵🇹\"\n```",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Country"
                }
            ],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 74,
                "path": "src/CountryService/Country.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "Code",
            "desc": "The code of the country e.g **US**",
            "lua_type": "string",
            "source": {
                "line": 33,
                "path": "src/CountryService/Country.lua"
            }
        },
        {
            "name": "Name",
            "desc": "Contains the name of the country e.g **US = \"United States\"**",
            "lua_type": "string",
            "source": {
                "line": 41,
                "path": "src/CountryService/Country.lua"
            }
        },
        {
            "name": "Emoji",
            "desc": "Contains the emoji of the country e.g **US = 🇺🇸**",
            "lua_type": "string",
            "source": {
                "line": 49,
                "path": "src/CountryService/Country.lua"
            }
        },
        {
            "name": "Decal",
            "desc": "Contains the flag of the emoji, it can be used for ImageLabels, Decals and ImageButtons!",
            "lua_type": "string",
            "source": {
                "line": 58,
                "path": "src/CountryService/Country.lua"
            }
        }
    ],
    "types": [],
    "name": "Country",
    "desc": "Contains the data for each country of this library. It is used to retrieve information\nsuch as a decal, emoji and name of a country to display it to the user.\n\n```lua\nlocal CountryService = require(ReplicatedStorage.CountryService)\n\nlocal country: CountryService.Country = CountryService:GetMyCountry()\n\n--Set the UI\nlocal screenGui: ScreenGui = playerGui:WaitForChild(\"Country\") :: ScreenGui\nlocal container: Frame = screenGui:WaitForChild(\"Container\") :: Frame\n\nlocal countryFlag: ImageLabel = container:WaitForChild(\"CountryFlag\") :: ImageLabel\nlocal countryInfo: TextLabel = container:WaitForChild(\"CountryInfo\") :: TextLabel\n\ncountryFlag.Image = country.decal\ncountryInfo.Text = `Hi! Welcome from {country.name} {country.emoji}`\n```",
    "source": {
        "line": 23,
        "path": "src/CountryService/Country.lua"
    }
}