Hey, so I went to write a simple function that automatically adds "\n" to a string if it gets too long.
This is what it like:
[CODE]local desctbl = string.ToTable("This is a test")
for i = 1,table.Count(desctbl) do
if i == 35 or i == 70 then
table.insert(desctbl,i,"\n")
end
end
local newstring = string.Implode(desctbl)[/CODE]
But it gives me this error:
[CODE]
[ERROR] addons/test/lua/autorun/client/test.lua:447: bad argument #1 to 'Implode' (table expected, got nil)[/CODE]
Note that this works:
[CODE]local desctbl = string.ToTable("This is a test")
for i = 1,table.Count(desctbl) do
if i == 35 or i == 70 then
table.insert(desctbl,i,"\n")
end
end
PrintTable(desctbl)[/CODE]
Is it a problem with the function?
Never mind, missed an argument.
Sorry, you need to Log In to post a reply to this thread.