local TextService = game:GetService("TextService")
local TweenService = game:GetService("TweenService")
local UI = script.Parent
local Frame = UI.TextFrame
local TextDefault = script:WaitForChild("Letter")
local X, Y = 0, 0
local TotalX = 0
local LastLetter : TextLabel = nil
local function TypeLetter(Letter : string)
if TotalX >= Frame.AbsoluteSize.X then Y += 1 TotalX = 0 X = 0 LastLetter = nil end
local Clone = TextDefault:Clone()
Clone.Text = Letter
local Position
if LastLetter ~= nil then
Position = UDim2.new(0, LastLetter.Position.X.Offset + TextService:GetTextSize(LastLetter.Text, LastLetter.TextSize, LastLetter.Font, LastLetter.AbsoluteSize).X + TextService:GetTextSize(Letter, Clone.TextSize, Clone.Font, Clone.AbsoluteSize).X, Y * Clone.Size.Y.Scale)
else
Position = UDim2.new(0, 0, Y * Clone.Size.Y.Scale)
end
TweenService:Create(Clone, TweenInfo.new(.3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
Position = Position,
})
Clone.Position = Position
Clone.Parent = Frame
X += 1
TotalX = Position.X.Offset
LastLetter = Clone
end
game.ReplicatedStorage.Event.Event:Connect(function(Sentence : string)
for i = 1, #Sentence do
TypeLetter(string.sub(Sentence, i, i))
task.wait(.05)
end
end)
Are you trying to do this in one text lable or multiple. If multiple i would recomend you not use that method. Espesialy since you can achive the same effec in side text labels useing the MaxVisibleGraphemes property