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:
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.
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:”
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
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