Advertisement
Barnet

ScrollText

Jun 7th, 2021
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. link = arg[1]
  2. if link == nil then
  3.   link = "Test.txt"  
  4. end
  5.  
  6. file = fs.open(link, "r")
  7. text = file.readAll()
  8. file.close()
  9.  
  10. scrollspeed = arg[2]
  11. if scrollspeed == nil then
  12.   scrollspeed = 0.1
  13. else
  14.   scrollspeed = tonumber(scrollspeed)
  15. end
  16.  
  17. looping = arg[3]
  18. if looping == nil then
  19.   looping = false
  20. end
  21. repeat
  22.   for i=1, string.len(text), 1 do
  23.     write(text:sub(i, i))
  24.     sleep(scrollspeed)
  25.   end
  26. until not looping
  27.  
  28. print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement