function file_exists(file)
local f = io.open(file, "rb")
if f then f:close() end
return f ~= nil
end
number = 0
function lines_from(file)
if not file_exists(file) then return {} end
lines = {}
for line in io.lines(file) do
lines[#lines + 1] = line
number = number + 1
end
return lines
end
file = 'C:\Users\Alex\Desktop\Project\scenes\test.txt'
lines = lines_from(file)
Ty for the quick answer. I've tried fixing that but it did not work so instead I started writing code from the scratch but no matter how I write it the program gets stuck at the io.input or io.open telling me that it can't find my file and I've placed that all over the place. I tried sending as parameter the whole path aswell.
All I need to do is open a txt file and read line by line nothing fancier ....