HttpService Help

For some reason i can print the lua table

but i cant print the name itself.
i’ve tried tutorials they didnt help

Whenever i try to print the name:
Screenshot 2025-06-08 011712

It returns nil.

Now i think this is a problem of the [1]
But i dunno how to get the name

heres the code

local hs = game:GetService("HttpService")
local url = "if i put the url it drafts offline its supposed to be a pastebin link"

local data = hs:GetAsync(url)

local decode = hs:JSONDecode(data)

print(decode)

print(decode.Name)

heres the json code

[
    {
        "Name": "Radiation Dummy",
        "info": {
            "Price": 1200,
            "LayoutOrder": 1
        }
    }
]

This is my first time trying out httpservices so its quite confusing for me lol

If you look at the raw JSON, it’s a dictionary inside an array. Looking at the decoded Lua table, it also has the array field. You’re trying to index the root table with Name, but you need to go through index 1 first, so it should be:

print(decode[1].Name)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.