local HttpService = game:GetService("HttpService")
-- ID de la place
local placeId = 7354654701
-- API pour récupérer les infos de la place
local url = "https://games.roblox.com/v1/games/" .. placeId .. "/servers/Public?sortOrder=Asc&limit=100"
local response = HttpService:GetAsync(url, true)
local data = HttpService:JSONDecode(response)
-- Boucle à travers les serveurs pour compter les joueurs
local playerCount = 0
for _, server in ipairs(data.data) do
playerCount = playerCount + server.playing
end
print("Nombre de joueurs dans la place " .. placeId .. ": " .. playerCount)
You can’t send direct requests to the Roblox servers using HttpService. You would need to use a proxy; there’s a couple of them on the forum you can use
Indeed, Roblox prevents direct requests to game servers using HttpService for security reasons. However, there are ways to use proxies to circumvent this limitation. However, it is important to note that using proxies to access Roblox resources may be considered a violation of the Roblox Terms of Service and may result in penalties against your account.