ServerRegion
Extra information about a game server's region, referenced by game.ServerRegion, such as geographic coordinates
and country.
Since this is a server-only module, ensure to list the package under [server-dependencies] within your
wally.toml file.
Memory Usage
Due to how Luau works, this module uses upwards of 7MB of heap memory. Therefore, it is recommended to use the
getAndDestroy() function, which will destroy the ModuleScript after fetching the region information. This will
free up the heap memory used. Call this function once and cache the result.
-- Custom ServerRegion ModuleScript which proxies the one-time call to getAndDestroy
return require(ServerStorage.ServerPackages.ServerRegion).getAndDestroy()
Types
Region
interface Region {Lat: number--
Latitude
Lon: number--
Longitude
Continent: stringCountry: stringIATA: string--
Three-letter location identifier
}Functions
get
Gets the server region.
getAndDestroy
Gets the server region, and then destroys the source ModuleScript to free up heap memory.