How to label a table inside of a text label.. Possible?

Hello. I was wondering it was possible to label a table in a text label. Is this possible? If so, how can I do this?

If you turn off “Log Mode” on the output with the 3 dots then you will get something like this when you print a table:

 {
   [1] =  {
      [1] = Value,
      [2] = Value,
      [3] = Value,
      [4] = Value,
      [5] = Value,
      [6] = Value,
      [7] = Value,
      [8] = Value,
      [9] = Value,
      [10] = Value
   },
   [2] =  {
      [1] = Value,
      [2] = Value,
      [3] = Value,
      [4] = Value,
      [5] = Value,
      [6] = Value,
      [7] = Value,
      [8] = Value,
      [9] = Value,
      [10] = Value,
      [11] = Value,
      [12] = Value
   },
   [3] =  {
      [1] = Value,
      [2] = Value,
      [3] = Value,
      [4] = Value,
      [5] =Value,
      [6] = Value,
      [7] = Value,
      [8] = Value,
      [9] = Value,
      [10] = Value
   }
}

I’m kind of looking for something like this…

The table in the script looks like this:

{{value, value}, {value, value}}

Maybe you can use httpservice to encode the table into a string?
And then set the text of the textlabel to that string? i dont know though, it’s maybe pretty messy once you do it

1 Like

So when I tried this, the table was successfully translated into a string that was able to be displayed by the text label. The problem however was that once it was in this form, there was no way to translate this back into the original table. Like for example, if I we’re to copy this and make a script to translate it back into the table with JSONdecode(), it would not work. I tried in fact and got this error:
https://gyazo.com/ad9fe28a8a58bebc533b3b28a9cf1b77

I dont think you need to decode it again, you have the original table not encoded, right?

I figured it out. What I was trying to do was make a map saving system that was activated with a code. For example, you build something and then you can use this string to load different kinds of maps.

In this process, you would need to display it and the json encode and decode worked. The only reason I got that error was because I did not have the encoded value in quotes when I decoded it.