Jump to content

Help for json


freudo

Recommended Posts

result is "no data"

I can't find any errors.

I did not share all the codes. It works well.

login.dataJson = "[{ \"money\": 0, \"point\": 0, \"wins\" }]"

if ( type ( result ) == "table" and #result > 0 or not result ) then
   for i,v in ipairs( result ) do
      if v.username == tostring(username) then
             outputChatBox("account name = "..tostring(v.username))
             local json = v.data or {}
             if json == false or json == nil then outputChatBox("no json") return false end
             local data = fromJSON(json)
             if data == nil then outputChatBox("no data") return false end
			 outputChatBox(tostring(v.money)) -- nil
      end
   end             
end 
  1.  
Edited by barikat
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...