-
What do you want to achieve? I want to get all the servers.
-
What is the issue? It wont let me get the ‘id’ element from a dictionary.
-
What solutions have you tried so far? I tried replacing it with its ‘number’ but still didn’t work.
local HttpService = game:GetService("HttpService")
local Servers = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..game.PlaceId.."/servers/Public?sortOrder=Asc"))
local Data = Servers["data"]
for _, v in pairs(Data) do
for i, v2 in pairs(v) do
print(i, v2) -- prints id <the id of the server>
print(v2["id"]) -- errors
end
end
Can somebody help me?