|
| 01 Jan 2014 01:12 PM |
How would you break up strings in a table to display in a Gui
Kind of like
r.Text = "T" wait(1) r.Text = "Te" wait(1) r.Text = "Tex" wait(1) r.Text = "Text"
But strings that are in a table
_StringTable = { "Lol"; "String"; "bro"; }
And display them in a Gui
So
repeat Gui.Text = ..? until not wait(5)
Medium Script0r |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 01:19 PM |
function displayText(string) for i = 1, string:len() do -- for i = 1, the length of the string do Gui.Text = string:sub(1, i) -- The part of the string from characters 1 to i end end
displayText(_StringTable[1])
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 01 Jan 2014 01:20 PM |
| What's the _StringTable[1] for? |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 01:22 PM |
_StringTable[1] is the first index of the table. Basically:
for i = 1, 10 do print(tbl[i]) -- I is the step number that you are on end
I was pretty much just making sure you understood how to use the function I wrote up for you.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 01:23 PM |
So you grab the length and then break it with :sub or string.sub.. Nice
thank you time to use it c:
Medium Script0r |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 01:37 PM |
k I made an edit and it erroed'
function displayText(string) for i = 1, string:len() do -- for i = 1, the length of the string do Gui.Text = string:sub(1, i) -- The part of the string from characters 1 to i end end
displayText(math.random(1, #_StringTable)) -- Supposed to pick random String from table and break it's characters
Medium Script0r |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 02:06 PM |
You forgot to index your random number:
displayText(_StringTable[math.random(1, #_StringTable)]) |
|
|
| Report Abuse |
|
|