Advertisement
EconomicSerg

local function typewrite()

Jan 4th, 2021
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. -- Add a screen gui, add a text label, add a local script
  2.  
  3. local textLabel = script.Parent -- The text label
  4.  
  5. wait(1) -- Wait until it starts
  6.  
  7. local function typewrite(object, text, length) -- The function
  8.     for i = 1,#text,1 do -- The text
  9.         object.Text = string.sub(text, 1, i) -- How it will work
  10.         wait(length) -- The time it takes to type out the enitre sentence
  11.     end
  12. end
  13.  
  14. typewrite(textLabel, "This is a test.", 0.02) -- Test
  15. wait(2)
  16. typewrite(textLabel, "I hope this works!", 0.02) -- Test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement