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

I can't jsondecode? I need help with jsondecoding, it doesn't seem to do it right..

Asked by 4 years ago
local http = game:GetService("HttpService")
local t = '[{"src":"Name00156 00144 034 034 034","src":"Name00256 00144 034 034 034","src":"Name00256 00144 034 034 034"}]'

wait(2)
local tab = http:JSONDecode(t)
print('printing table')
I = 0
for i,v in pairs(tab[1]) do
    I = I + 1
    print(v .. " num = " .. I)
end

It only outputs the first value and not the other. What am i doing wrong?

1
because they're the same key. Each key is "src". You might be able to do t[1], t[2], t[3] mybituploads 304 — 4y

Answer this question