local DaTable = {TimeString = "19/6/2016",EnemyString = "Hi" ,OfficialBool =true,WinBool = true} local NewTable = {} table.insert(NewTable,1,DaTable) print(table.concat(NewTable[1], " "))
What it prints out is "" <--- Equal to nil How do i fix that?
Take a look at the wiki explanation for table.concat
:
"Given an array where all elements are strings or numbers..."
DaTable
doesn't fit either of those requirements. It's not an array, and it has both booleans and strings. That's why it doesn't work with table.concat
. Other than that your code is fine.
You could write your own table.concat
function if you wanted to:
function concatenate(table) local str = "" for key, value in pairs(table) do str = str .. " " .. tostring(value) end return str end