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

JSon not exactly working? More clarification? maybe?

Asked by 6 years ago

Hey guys, I just wanted to test this JSonEncode / Decode thing and apparently I am really confused

local HttpService = game:GetService("HttpService")
 local numb = 1
local characterStats = {}
local json = HttpService:JSONDecode(characterStats)
print(json)
print("Works")
table.insert(characterStats, "hello"..numb)
numb = numb + 1
json = HttpService:JSONEncode(characterStats)
print(json)
print("(2) works")

I did that ^ hoping that "numb" the variable would add + 1 and it would save but I am very confused with this and that is why I came here.. To get clarification on JSon, Can someone help me figure out how to use JSon?

1 answer

Log in to vote
0
Answered by 6 years ago

You set the characterStats immediately before decoding it. You need to use the saved value or whatever you used, and it needs to be a string. Other than that, it should be fine.

Hope this helps!

0
thx greatneil80 2647 — 6y
0
I will check it later man greatneil80 2647 — 6y
Ad

Answer this question