I’m making a debug menu, and one part of that is showing where the Roblox server the game is connecting to is. I have seen other games (like Arsenal) do this, so how would I?
Try that
local regionTextLabel = script.Parent -- Replace with the actual TextLabel in your game
local function updateRegion()
local region = game:GetService("LocalizationService"):GetRegion()
regionTextLabel.Text = "Server Region: " .. region
end
-- Initial update when the script runs
updateRegion()
-- Update the region periodically (every 10 seconds)
while true do
wait(10)
updateRegion()
end
1 Like
Here is an updated version, and dont forget to enable Security Permission in your game!
local LocalizationService = game:GetService("LocalizationService")
-- Reference to the TextLabel in your debug menu
local regionTextLabel = script.Parent.TextLabel -- Replace with the actual TextLabel in your debug menu
-- Function to update the region information
local function updateServerRegion()
local region = LocalizationService:GetRegion()
regionTextLabel.Text = "Server Region: " .. region
end
-- Initial update when the script runs
updateServerRegion()
-- Update the region periodically (e.g., every 10 seconds)
while true do
wait(10)
updateServerRegion()
end
1 Like
Still didn’t work. It doesn’t look like :GetRegion() is a function.
Please don’t respond to questions by using ChatGPT. Especially with Roblox, which has implemented a couple very important features recently (like parallel luau) and does not have a massive presence in ChatGPT’s language model - you’re going to get inaccurate results and calls to methods that do not exist. If you know the solution, then say the solution. If you don’t, then you don’t.
15 Likes
You need HTTP Requests on.
local url = "http://ip-api.com/json/"
local httpsservice = game:GetService("HttpService")
local getasyncinfo = httpsservice:GetAsync(url) -- roblox server will get info from that link
print("Server Location: "..string.sub(tostring(getasyncinfo),31,37))
7 Likes
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.