Hi, I understand scripting quite well, but I’m not very familiar with string patterns. I’m working on a plugin and I need to split multiline strings. Only this problem:
local String = [[v 1,1,1
v 2,2,2
v 3,3,3
v 4,4,4
v 5,5,5,
]]
local Table = string.split(String, "/n") --Split all line
for i,v in ipairs(Table) do
wait(5)
print(i,v)
end
For example, when I run this code here
Then the code waits for 5 seconds the first time, but after the second time it doesn’t even wait and it plays the whole thing. But I have to play every single line. How do I do that?
Ok, i need to print all line separately (this was my question) but it need to yelds. It’s hard to explain this, so I used this code before, but it went wrong (instead of playing the loop normally, it only plays once and it gives me all the lines directly). And no, your method doesn’t work but thanks for trying (and no, I can’t use variables because firstly the string can always change and secondly mine has over 800 lines)