local HttpService = game:GetService("HttpService")
local placeId = "PLACE_ID"
local url = "https://games.roblox.com/v1/games/" .. placeId .. "/servers/Public?limit=100"
local success, response = pcall(function()
return HttpService:GetAsync(url)
end)
if success then
local serverData = HttpService:JSONDecode(response)
local servers = serverData.data
if #servers > 0 then
local randomServer = servers[math.random(1, #servers)]
print("Random Server ID:", randomServer.id)
else
print("No available servers found.")
end
else
warn("Failed to retrieve server data:", response)
end
ERROR: Failed to retrieve server data: Attempt to call blacklisted method
Oh sorry, I missed the part where it said client side. You can’t run HTTP request on the client due to security reasons, you can use a remote function or remote event for it