How to get a Server Location/Region on Roblox

I have tried this before with my game, it will return a false server location. You should use the timezone from the API instead of the city.

This is most likely how it is used in games:

local HttpService = game:GetService("HttpService")
local PlayerService = game:GetService("Players")

local API = "http://ip-api.com/json/"
local info = HttpService:JSONDecode(HttpService:GetAsync(API))

local function onPlayerAdded()
	local success, errorMessage = pcall(function()
		return
	end)

	if success then
		print("Server Location: "..tostring(info["timezone"]))
	end

	if errorMessage then
		warn(errorMessage)
	end
end

PlayerService.PlayerAdded:Connect(onPlayerAdded)

Server Outcome:
unknown

Here is another outcoome of when I used remotes and user interface:
unknown (1)

5 Likes