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:
01 | local HS = game:GetService( "HttpService" ) |
02 |
03 | script.Parent.Enter.MouseButton 1 Click:connect( function () |
04 | local x = HS:GetAsync( "https://getbible.net/json?p=James" , false ) |
05 | local y = HS:JSONDecode(x) |
06 | wait() |
07 | for i,v in pairs (y) do |
08 | print (v) |
09 | end |
10 | end ) |
The site you provided does not have a properly formatted string.
also, connect
is deprecated, use Connect
:D
01 | local HS = game:GetService( "HttpService" ) |
02 | local x = HS:GetAsync( "https://getbible.net/json?p=James" , false ) |
03 |
04 | --Properly format le string |
05 | local y = HS:JSONDecode(x:sub( 2 ):reverse():sub( 3 ):reverse()) |
06 |
07 | function readTab(tab) |
08 | local function f(t) |
09 | wait(); |
10 | for i,v in next ,t do --Iterate through each index |
11 | if type (v) ~ = "table" then --if it's not a table |
12 | if i:match( "verse" ) then --and it's key says 'verse' |
13 | print (i.. " : " ..v); --print it |
14 | end |
15 | else --otherwise |