Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

2 comments

1

I use this one liner a lot for debugging: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ print("Data: ",game:GetService("HttpService"):JSONEncode( info)) ~~~~~~~~~

0

That worked great didn't have the info I need in it but it did print the whole table. TY

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.