-- Open the file containing the story text local file = io.open("story.txt", "r") local storyText = file:read("*all") file:close() -- Print out the story text character by character for i = 1, #storyText do io.write(storyText:sub(i, i)) io.flush() -- flush output to ensure characters are printed immediately os.sleep() -- wait for 0.05 seconds to slow down the printing speed end