local ClickDetector = script.Parent.ClickDetector --Makes the GUIs visible, then does the text.
ClickDetector.MouseClick:connect(function(User)
local player = User
local dialogue = player.PlayerGui.ScreenGui1.DialogueBox
local close = player.PlayerGui.ScreenGui1.CloseButton
local name = player.PlayerGui.ScreenGui1.NameBox
local option1 = player.PlayerGui.ScreenGui1.Option1
local option2 = player.PlayerGui.ScreenGui1.Option2
name.Visible = true
option1.Visible = true
option2.Visible = true
close.Visible = true
dialogue.Visible = true
name.Text = "Cassie"
option1.Text = "Sure!"
option2.Text = "No, thanks."
dialogue.Text = string.sub("Hello.", 1, 6)
end)
This is everything I have so far. It is for my rpg game where I am making my own dialogue gui. I want the text to appear letter by letter, and I think that in order to make that work, I need to use string.sub for maximum efficiency. My problem is, I don't know how to efficiently change the value of the second number '6' or any other amount by adding 1. Of course, it'd start as only having 1, 1 then I need it to add 1 to the second number until everything in the string is on screen, then it'd stop until activated again when an option is pressed (which is in a different script) So, please help?

2 comments
For loop.
I know that, but I don't actually know how to do it correctly.