Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont my JSON code work? Im working with HTTP Service.

Asked by 2 years ago

Im trying to have an array of "doors" inside JSON. Each door needs a "Title" and a "Script" string value. For example this is what i'm tryna do:

Door_One = {"Title" = "Door One", "Script" = "Door One Script"}
Door_Two = {"Title" = "Door Two", "Script" = "Door Two Script}

Im not familiar with how roblox parses JSON code. Im needing JSON code that can do this. Here is the current JSON code I have currently:

{
    "DoorOne": {"Title":"Door One Title","Script","Door One Script"}
}

and this is its server script ( This is for a PLUGIN, this is why i'm using a server script):

local HttpService = game:GetService("HttpService")
local URL = "https://pastebin.com/raw/RgTsmr5N"
local Data = HttpService:GetAsync(URL)
local jsonTable = HttpService:JSONDecode(Data)
print(jsonTable)
print("Complete")

1 answer

Log in to vote
1
Answered by 2 years ago
{
    "DoorOne": {"Title":"Door One Title","Script":"Door One Script"}
}
Ad

Answer this question