|
| 06 Apr 2016 08:41 PM |
So I'm trying to save a table on datastore (data={kills=0,deaths=0,level=0} Upon trying to print, it returns few irrelevant numbers and few letters, is there something wrong?
|
|
|
| Report Abuse |
|
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
|
| 06 Apr 2016 08:45 PM |
The table is encoded, it says something like "table: abc123"?
Try doing JsonDecode if you have httpservice enabled, or just do something like this:
for i = 1,#table do print(table[i]) end
Someone correct me if there's a better way to print everything in a table, because this feels really inefficient to me. |
|
|
| Report Abuse |
|
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
| |
|
| |
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
|
| 06 Apr 2016 08:48 PM |
| Oh, to answer the second part of your question: No, there's nothing wrong. It's supposed to do that. |
|
|
| Report Abuse |
|
|
regentia
|
  |
| Joined: 07 Feb 2011 |
| Total Posts: 66 |
|
|
| 06 Apr 2016 08:51 PM |
you could do it like
print(unpack(data)) or print(table.concat(data,", "))
but you wouldn't see the table's keys which would make recognizing the data harder
this is also a viable option
for i,v in next,data do print(tostring(i)..": ",v) end |
|
|
| Report Abuse |
|
|
regentia
|
  |
| Joined: 07 Feb 2011 |
| Total Posts: 66 |
|
|
| 06 Apr 2016 08:53 PM |
| never mind the first methods i showed you, they only work with keys that are integers |
|
|
| Report Abuse |
|
|