Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to I make a gui look like it is typing the sentence?

how to I make a gui look like it is typing the sentence?
please help

1 answer

✓ Accepted answer

####The parameter names I used aren't the ones in the wiki, they weren't very descriptive so I made my own

###sub is short for substring string.sub(target, starting, ending) will return substring from string target starting at starting and ending at ending. Note that you don't need to provide ending, it will default to the length of the string if you don't need it.

Examples with string.sub

print(string.sub("Hello", 2, 4)) --> ell
print(string.sub("World", 1)) --> World
print(string.sub("foo bar", 2, 4)) --> oo b

If starting is negative, it will start from the end of the string rather than the start, so string.sub("Hello", -1) would return o because it is the last character.

print(string.sub("Lua", -1)) --> a
print(string.sub("strings", -2)) --> gs (last 2 characters) 

Here is some sample code:

local text = "some text here"

for i = 1, #text do -- # is the length operator
    print(string.sub(text, 1, i))
end

Next time you should try it first, or search the site.


######Hopefully this answered your question, and if it did, then don't forget to hit that "Accept Answer" button. If you have any other questions, then feel free to leave them down in the comments.

1 comment

1

sellout

This discussion is preserved as it was. New answers, comments, and votes are closed.