I want to create a customized print() function that would print the arguments to the console and then also put them in a StringValue.
I read an article on how to do that. My code is as the following:
function printConsole(...)
coroutine.wrap(function(arg)
local toPrint=""
print(arg)
for _,v in pairs(arg) do
toPrint=toPrint..tostring(v)
end
print(toPrint)
workspace.ToPrint.Value=workspace.ToPrint.Value..toPrint.."\n"
end)(arg)
end
print("Hi", "there!")
At the for loop it breaks because arg is nil, not a table.
At print(arg) it says: "Hi" so it thinks arg is a string.

2 comments
As said, in that LUA book, some things may not be able to do in Roblox.
Actually, no. ROBLOX does not modify that sort of implementation, that would be insane. The examples in PIL don't work in real, standalone Lua installations, either, which confused me the other day.