What do you want to achieve?
I want to achieve the affect where several roblox games can use this one JSON url to create a scoring system
What is the issue?
I don’t know how to get just one of the values… I’m using the HttpService:GetAsync(url) which gets me the entire json object but I want to grab just one value (example: "Pink":"0")
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
local HttpService = game:GetService("HttpService")
local TeamScoresURL = "THE URL GOES HERE"
print(HttpService:GetAsync(TeamScoresURL))
You can use the JSONDecode method of HttpService to parse the JSON string to a Lua dictionary.
local results = --//http request
local data = game:GetService("HttpService"):JSONDecode(results)
print(data.Pink) --//something similar to this, haven't done this before but yee
As of right now it has the error Can't parse JSON not really sure why. Even when I try to just print data
The current script I have right now is
local HttpService = game:GetService("HttpService")
local TeamScoresURL = "url removed as I don't the devforums link rules"
local results = HttpService:GetAsync(TeamScoresURL)--//http request
local data = HttpService:JSONDecode(results)
print(data)