So i'm trying to get a table off a website... But I can't seem to get it. Any idea why? Heres my scirpt:
local HS = game:GetService("HttpService") script.Parent.Enter.MouseButton1Click:connect(function() local x = HS:GetAsync("https://getbible.net/json?p=James", false) local y = HS:JSONDecode(x) wait() for i,v in pairs(y)do print(v) end end)
The site you provided does not have a properly formatted string.
also, connect
is deprecated, use Connect
:D
local HS = game:GetService("HttpService") local x = HS:GetAsync("https://getbible.net/json?p=James", false) --Properly format le string local y = HS:JSONDecode(x:sub(2):reverse():sub(3):reverse()) function readTab(tab) local function f(t) wait(); for i,v in next,t do --Iterate through each index if type(v) ~= "table" then --if it's not a table if i:match("verse") then --and it's key says 'verse' print(i.." : "..v); --print it end else --otherwise f(v) --do this all again on the table end end end f(tab); end script.Parent.Enter.MouseButton1Click:Connect(function() readTab(y); end)