I want to make a typewriter animation for my intro but it is only showing the first letter.
local introText = "Hello World!" for i = 1, #introText do t_text.Text = string.sub(introText, 1, i) wait(0.5) end
(Full Script)
-- Create Gui local gui = Instance.new("ScreenGui",game.StarterGui) local fillTop = Instance.new("Frame",gui)-- Fills in the little spot at the top of the screen local back = Instance.new("Frame", gui) local t_text = Instance.new("TextLabel",back) -- Style Gui local bxSize = 1-- Make Background fill the whole screen local bySize = 1 local bcr,bcg,bcb = .1, .7, 1-- RGB Color background 0 to 1 local fcr,fcg, fcb = bcr,bcg,bcb -- Same Color as background local fxSize = 1 local fySize = .055 local fyPos = -.054 local txPos = .5 local tyPos = .5 local tcr,tcg,tcb = 255, 255, 255 local introText = "Hello World!" -- Fill fillTop.Size = UDim2.new(fxSize,0,fySize,0) fillTop.Position = UDim2.new(0, 0, fyPos ,0) fillTop.BackgroundColor3 = Color3.new(fcr, fcg, fcb) -- Background back.Size = UDim2.new(bxSize,0,bySize,0) back.BackgroundColor3 = Color3.new(bcr, bcg, bcb) -- Text t_text.Position = UDim2.new(txPos, 0 , tyPos, 0) t_text.TextColor3 = Color3.new(tcr,tcg,tcb) t_text.Font = "SourceSansLight" t_text.TextScaled = true t_text.BorderSizePixel = 0 -- Typewriter animation for i = 1, #introText do t_text.Text = string.sub(introText, 1, i) wait(0.5) print(t_text.Text) end
-- Create Gui local gui = Instance.new("ScreenGui",game.StarterGui) local fillTop = Instance.new("Frame",gui)-- Fills in the little spot at the top of the screen local back = Instance.new("Frame", gui) local t_text = Instance.new("TextLabel",back) -- Style Gui local bxSize = 1-- Make Background fill the whole screen local bySize = 1 local bcr,bcg,bcb = .1, .7, 1-- RGB Color background 0 to 1 local fcr,fcg, fcb = bcr,bcg,bcb -- Same Color as background local fxSize = 1 local fySize = .055 local fyPos = -.054 local txPos = .5 local tyPos = .5 local tcr,tcg,tcb = 255, 255, 255 local introText = "Hello World!" -- Fill fillTop.Size = UDim2.new(fxSize,0,fySize,0) fillTop.Position = UDim2.new(0, 0, fyPos ,0) fillTop.BackgroundColor3 = Color3.new(fcr, fcg, fcb) -- Background back.Size = UDim2.new(bxSize,0,bySize,0) back.BackgroundColor3 = Color3.new(bcr, bcg, bcb) -- Text t_text.Position = UDim2.new(txPos, 0 , tyPos, 0) t_text.TextColor3 = Color3.new(tcr,tcg,tcb) t_text.Font = "SourceSansLight" t_text.TextScaled = true t_text.BorderSizePixel = 0 -- Typewriter animation for i = 1, string.len(introText) do t_text.Text = tostring(string.sub(introText, 1, i)) wait(0.5) print(t_text.Text) end