How to make typewriter style text for a cutscene

Hello, i was wondering if any of you could help me make a part in a cut scene where a gui shows up on the players screen (this is a one player server / game) and then says some test of the story line in the gui with a typewriter effect.

i would like to create it in this section of the cutscene script:

It would be good if you could tell me how to do this or show me an example.

-FastTheDev

2 Likes

Set the MaxVisibleGraphemes property of the guiLabel to 0, then insert the text into the Text property, now make a loop like so:

local label = -- your guiLabel
local text = -- your text

label.MaxVisibleGraphemes = 0
label.Text = text
for i = 0, string.len(text) do
   label.MaxVisibleGraphemes = i
   wait(.05) -- wait 1 second divided by how many characters you want to appear per second
end

In case you don’t understand MaxVisibleGraphemes, it sets how many characters can be visible at the start of the guiLabel.

1 Like

Oh, ok thanks alot, i think i get it now… let me try it quick.

Whats the difference between the “gui label” and the “text”?

text is the string you’re placing, guiobject is the textlabel

It dosent seem to be working for some reason.

What does it do/not do? And may I see what your script looks like?

Can u test the file now to see whats wrong and then tell me pls?
I have no idea whats wrong : /

CameraTest.rbxl (46.4 KB)

Copy and paste the script instead of a screenshot please.

1 Like
local Camera = workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Point1 = workspace.Point1
local Point2 = workspace.Point2
local open = workspace.Dummy.Head.Open
local closed = workspace.Dummy.Head.Closed

local function TweenCamera(Pos)

	local TweenService = game:GetService("TweenService")

	local TweenInf = TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)

	local Tween = TweenService:Create(Camera, TweenInf, {CFrame = Pos})

	Tween:Play()

end

wait(5) -- wait 5 seconds after the player joined the game


TweenCamera(Point2.CFrame)

--Put GUI part here: 

Camera.CameraType = Enum.CameraType.Custom

I would like to put the “typewriter effect subtitles” where i said “–Put GUI part here:”

done that, could you please help?

What’s the issue now? This is different from the original script.

its the same problem, i just deleted the unnecessary bits of the code

try doing

local gui = --your gui here
local targetstring = --the string you want to display
for i = 1, #targetstring do
    local text = targetstring:sub(1,i)
    gui.Text = text
end

could you give me an example of what to fill the blank spaces with, because i tried that earlier but it didnt work

You just provided the tweening part of the code not the text generation.

The problem is i dont know how to make the typewriter effect or display the text in the text box

so what you want to do is fill the gui = with the textlabel you want to display the typewritter effect and in the targetstring just put what you want to say in the gui for example targetstring = "oh no our table its broken" lmao

1 Like