Table gets printed as some weird code in game. How to make it print its values

So i want to print a table without it being encoded like this in game

any idea?
i tried using concat and unpack nothing worked

Looks like you’re printing out the table’s memory address. Displaying tables only work in Studio outputs though and for in-game, you have to print it traditionally using a for loop.

2 Likes

The console won’t properly display the tables contents correctly, it only prints properly from studio.

You’d probably need to print all the contents yourself via a pairs loop, if you want it to resemble a table, you can probably use this function

local function printTable(t)
	local str = ""
	for i, v in ipairs(t) do
		str = str .. string.format("\t[%d] = %f,\n", i, v)
	end
	print(string.format("local tab = {\n%s}", str))
end

Taken from the below

1 Like

i tried it. Still Doesnt work for some reason

Oh, apparently, I almost forgot that there was a setting called Log Mode on Studio. You can find here:

1 Like

I don’t think that this has to do with the in game developer console, Maybe i wasn’t more clear But anyways Thanks dude! my man came after 1 month again

1 Like