Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I see what is in a Table that was printed in the output?

Asked by
DBoi941 57
5 years ago
Edited 5 years ago

In the the output it gives me a table like this: table: 0000025E00000000 what I am trying to do is see what is stored in that table. I know you can get Updated from this but I was wanting to know what other information can come from this table also. What the end goal is, If i can get the game Version History from this, Or is there another way to do that. Thank you for any help.

local MS = game:GetService("MarketplaceService")
local Pid = game.PlaceId
    while true do
pcall(function()
local info = marketplaceservice:GetProductInfo(Pid)
    print(info)
    end)
wait(60)
end
1
I use this one liner a lot for debugging: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ print("Data: ",game:GetService("HttpService"):JSONEncode( info)) ~~~~~~~~~ goreacraft 1 — 5y
0
That worked great didn't have the info I need in it but it did print the whole table. TY DBoi941 57 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

It's simple, Printing a table will print the entirety of the table but "Decoded". Do:

print(myTable[1])

if you want to see the first element/object of that table. Here's what you can do if you want to see all elements:

print(table.concat(myTable,", "))

table.concat creates a string with all the objects inside the table separated, You can change the second argument if you want to separate them differently.

Example:

myTable = {"I","am","cool"}

print(table.concat(myTable,", "))

Result:

I, am, cool

Example 2:

myTable = {"I","am","cool"}

print(table.concat(myTable," "))

Result:

I am cool

Ad

Answer this question