• Calling tables & JSON not working right?
    0 replies, posted
Ok here is what I have; initial file \/ [CODE]Ability = {} anum = 0 function AbilityAPI_Add( defin, abil ) if not Ability[defin] then Ability[defin] = {} end anum = anum + 1 if anum == 6 or abil == "done" then SetGlobalString( "abilities", util.TableToJSON( Ability ) ) PrintTable( util.JSONToTable( GetGlobalString( "abilities" ) ) ) table.Empty( Ability ) anum = 0 else if not IsValid( Ability[defin][anum] ) then Ability[defin][anum] = abil end end end[/CODE] other files in other addon folders; [CODE]AbilityAPI_Add( "reaper", "wraith_form" ) AbilityAPI_Add( "reaper", "shadow_step" ) AbilityAPI_Add( "reaper", "death_blossom" ) AbilityAPI_Add( "reaper", "done" )[/CODE] [CODE]AbilityAPI_Add( "test", "dad" ) AbilityAPI_Add( "test", "mum" ) AbilityAPI_Add( "test", "brother" ) AbilityAPI_Add( "test", "sister" ) AbilityAPI_Add( "test", "cousin" ) AbilityAPI_Add( "test", "done" )[/CODE] And yes, they include the initial file above /\ It works perfectly, just my problem is that the ability is doubled in the table... CONSOLE [CODE]reaper: 1 = wraith_form 2 = shadow_step 3 = death_blossom reaper: 1 = wraith_form 2 = shadow_step 3 = death_blossom test: 1 = dad 2 = mum 3 = brother 4 = sister 5 = cousin test: 1 = dad 2 = mum 3 = brother 4 = sister 5 = cousin [/CODE] All help will be appreciated (if you know what your doing of course) [editline]16th July 2017[/editline] Any ideas? [editline]16th July 2017[/editline] ??
Sorry, you need to Log In to post a reply to this thread.