How to check what server region you are playing in

So i was playing island royal and my ping was rlly high and kyu_t said its because we are in a au server, so i was wonder if anyone knew how to know hats server region you are playing in when you join a game,oh yeah i live in georgia

2 Likes

The following thread may have the answer you’re looking for:

1 Like

Here, I made a function that gets the IP of the server, then gets the Geo location of the server. Make sure to have HTTP requests enabled. this will return a tuple. The results are for example: FL, Florida

function GetServerRegion()
	local http = game:GetService("HttpService")

	local result
	
	local g,b = pcall(function()
		result = http:JSONDecode(http:GetAsync("https://api4.my-ip.io/ip.json"))
	end)

	local ip = result.ip
	
	if g and ip then
		local location
		local good,bad = pcall(function()
			location = http:JSONDecode(http:GetAsync("http://ip-api.com/json/"..ip))
		end)
		if good and location.region and location.regionName then
			return location.region , location.regionName
		else
			warn("fatal error fetching server geo location. error: "..bad)
			return nil, nil
		end
	else
		warn("fatal error fetching server ip. error: "..b)
		return nil, nil
	end
end
19 Likes

This post was flagged by the community and is temporarily hidden.

9 Likes

apparently LOL I just found out

Thank you so much,this is amazing

1 Like