So I am finding out how to make a NPC dialog from the camping series. Can someone show me how maybe to do it with instructions? I am a expert editor so by you explaining things I will be able to learn, I see what you did and not make the same mistake I did by attempting to do something I am confused about xD. Thanks, this should be fairly easy so please help if you have some spare time. Thanks!
The NPC will not be talking by a overhead surfacegui but a gui that is shown locally with the name of the NPC, and its dialog. In this case, I only need the dialog part done. Also the text should be written like typewriter please.
Easier way would be to use string.sub(t, i, j), it returns a sub string starting at i and ending at j from the whole string provided.
Example:
local myString = "Hello" print(string.sub(myString, 0, 3)) -- Alternate Method = myString:sub(0, 3) --[[ Output: Hel ]] --
So we start at the 0th character (the start) and we finish at the 3rd, which gives the answer "Hel" (H = 1, E = 2, L = 3)
So with this knowledge, we can use a loop to make a typewriter function,
local myString = "Hello" local text = "YourTextGoesHere" for i = 1, string.len(text) do -- string.len() gives the length of the text LOCATIONOFTEXTLABEL.Text = string.sub(text, 1, i) wait(0.05) end