Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- // Made By: 27st3, Discord: Sectly_playz#1404
- -- // Makes A Cool TypeWriter Screen Text Effect With Rich Text Support! | (Roblox:TypeWriter.Lua)
- --[[ -- // How To Use:
- -- // Main:
- Call Function: | Text Input: | Wait Time In Seconds:
- Write("Your Text Here!", 5)
- -- // Rich Text:
- Bold:
- Write("Your <b>Text</b> Here!", 5)
- Underline:
- Write("Your <u>Text</u> Here!", 5)
- Italic:
- Write("Your <i>Text</i> Here!", 5)
- --]]
- repeat wait() until game.Players.LocalPlayer.PlayerGui
- local RunService = game:GetService("RunService")
- local PlayerGui = game.Players.LocalPlayer.PlayerGui
- local TypeWriter = Instance.new("ScreenGui")
- local Container = Instance.new("Frame")
- local ListLayout = Instance.new("UIListLayout")
- local Padding = Instance.new("UIPadding")
- TypeWriter.Name = "TypeWriter"
- TypeWriter.Parent = script
- TypeWriter.ResetOnSpawn = false
- Container.Name = "Container"
- Container.Parent = TypeWriter
- Container.AnchorPoint = Vector2.new(0.5, 0.5)
- Container.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Container.BackgroundTransparency = 1.000
- Container.BorderColor3 = Color3.fromRGB(0, 0, 0)
- Container.BorderSizePixel = 0
- Container.Position = UDim2.new(0.5, 0, 0.5, 0)
- Container.Size = UDim2.new(1, 0, 1, 0)
- ListLayout.Name = "ListLayout"
- ListLayout.Parent = Container
- ListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- ListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- ListLayout.VerticalAlignment = Enum.VerticalAlignment.Bottom
- ListLayout.Padding = UDim.new(0, 5)
- Padding.Name = "Padding"
- Padding.Parent = Container
- Padding.PaddingBottom = UDim.new(0.25, 0)
- Padding.PaddingLeft = UDim.new(0.25, 0)
- Padding.PaddingRight = UDim.new(0.25, 0)
- Padding.PaddingTop = UDim.new(0.25, 0)
- function Write(Text, Wait)
- coroutine.wrap(function()
- local Screen = PlayerGui:FindFirstChild("TypeWriter")
- if not Screen then
- Screen = TypeWriter
- Screen.Parent = PlayerGui
- end
- local Message = Instance.new("TextLabel")
- Message.Name = "Message"
- Message.Parent = script
- Message.AnchorPoint = Vector2.new(0.5, 0.5)
- Message.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Message.BackgroundTransparency = 1.000
- Message.BorderColor3 = Color3.fromRGB(0, 0, 0)
- Message.BorderSizePixel = 0
- Message.Position = UDim2.new(0.5, 0, 0.5, 0)
- Message.Size = UDim2.new(1, 0, 0, 20)
- Message.Font = Enum.Font.Gotham
- Message.RichText = true
- Message.Text = ""
- Message.TextColor3 = Color3.fromRGB(255, 255, 255)
- Message.TextSize = 20.000
- Message.TextStrokeTransparency = 0.500
- Message.Parent = Screen.Container
- Message.Text = Text
- Message.Size = UDim2.new(1,0,0,Message.TextBounds.Y)
- local Index = 0
- local DisplayText = Text
- DisplayText = DisplayText:gsub("<br%s*/>", "\n")
- DisplayText = DisplayText:gsub("<[^<>]->", "")
- for _ in utf8.graphemes(DisplayText) do
- Index = Index + 1
- Message.MaxVisibleGraphemes = Index
- wait(0.005)
- end
- wait(Wait)
- for _ in utf8.graphemes(DisplayText) do
- Index = Index - 1
- Message.MaxVisibleGraphemes = Index
- wait(0.005)
- end
- Message:Destroy()
- end)()
- end
Add Comment
Please, Sign In to add comment