What is the problem?
The problem is that it is not scrolling a specific piece of Text (a sequence of a String), but instead keeps doing something else than what it is supposed to do, and sometimes skips a line; However, I have indicated where the problem is.
Was there any Output?
Sadly, I can not provide any, as it is not giving any errors, however, I have added print functions for specific parts of the code, but they are not printing correctly either (it's not doing specific lines that the code is supposed to do, and sometimes skips a line).
What is the code? Can you provide it?
Yes, I can provide the code, however, it is very confusing, and I have done a lot of changes to try and get it to work finally, but all attempts resulted in the same thing. Here is the code:
local sl = {1}; local ll = {};
local msg = "I'm|a|string!|:D"
for q = 1, #msg do
if msg:sub(q,q) == "|" then
table.insert(sl,q + 1)
table.insert(ll,q - 1)
end
end
if #sl == 0 then
table.insert(sl,msg)
else
for x = 1, #sl do
if sl[x] and ll[x] then
print(sl[x],ll[x],msg:sub(sl[x],ll[x]))
elseif sl[x] and not ll[x] then
print(sl[x],msg:sub(sl[x]))
end
end
end
print("Start Scroll")
for x = 1, #sl do --The problem is in this chunk somewhere I'm guessing
local CurMes = sl[x] and ll[x] and msg:sub(sl[x],ll[x]) or sl[x] and msg:sub(sl[x])
for k = 1, #CurMes do
if sl[x] and ll[x] and CurMes:sub(sl[x],ll[x]) ~= "" then
print(CurMes:sub(1,k))
elseif sl[x] and CurMes:sub(sl[x]) ~= "" then
print(CurMes:sub(1,k))
end
wait(1/25)
end
wait(2.5)
end
print("Finished scroll")

2 comments
What exactly are you trying to do? I have a gut feeling that you're overcomplicating something easy.
Well, the script is supposed to take apart the String when the first 'for' loop reaches every '|' in the string, then returns the first, and end position into 'sl', and 'll' (the tables), then after so, proceeds to attempt to right out the separated strings (starting at line 24).