xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
|
| 24 Sep 2015 03:56 PM |
part.name ="h" wait(.1) part.name = "hi"
http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$639 Tx1,818 |
|
|
| Report Abuse |
|
|
Stymi
|
  |
| Joined: 19 Sep 2015 |
| Total Posts: 1077 |
|
|
| 24 Sep 2015 03:57 PM |
for i = 1, #str do text = text..str:sub(i, i) end |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2015 03:57 PM |
That's the most efficient way to do it if you only have 2 strings like that.
-The [Guy] |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2015 03:59 PM |
If you want a word to spell itself out:
local str = "hello" for i = 1, #str do text = text..str:sub(1, i) end
> h > he > hel > hell > hello
previous poster would have output:
> h > e > l > l > o
-The [Guy] |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2015 04:00 PM |
Sorry I didn't read his code carefully. His code was fine. Lol my code wouldn't work, it would get really messed up.
Either this: local str = "hello" for i = 1, #str do text = text..str:sub(i, i) end
or this: local str = "hello" for i = 1, #str do text = text:sub(1, i) end
will work fine.
-The [Guy] |
|
|
| Report Abuse |
|
|
Stymi
|
  |
| Joined: 19 Sep 2015 |
| Total Posts: 1077 |
|
| |
|
|
| 24 Sep 2015 04:01 PM |
I corrected myself, I read your code wrong at first.
-The [Guy] |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2015 04:02 PM |
for i = 1,string.len(text) do Whatever.Name = string.sub(text,1,i) end |
|
|
| Report Abuse |
|
|
Stymi
|
  |
| Joined: 19 Sep 2015 |
| Total Posts: 1077 |
|
|
| 24 Sep 2015 04:03 PM |
| first one is fine what are you trying to accomplish insane |
|
|
| Report Abuse |
|
|
xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
|
| 24 Sep 2015 04:08 PM |
@sty local text = "derp"
for i = 1, #str do script.Parent.Text = text..str:sub(i, i) end
>Str is unkown
http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$639 Tx1,818 |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2015 04:09 PM |
you defined your variable as "text" and you tried to call it "str"... be consistant yo :P Also you probably want the wait(.1) in your loop so it doesn't write it all at once.
-The [Guy] |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Sep 2015 04:11 PM |
Insane, you literally posted the same thing I did, but used string.len() instead of # lol
local text = "hello"
for i = 1, #text do part.Name = text:sub(1,i) wait(.1) end
thats about the best it gets. :P
-The [Guy] |
|
|
| Report Abuse |
|
|
Stymi
|
  |
| Joined: 19 Sep 2015 |
| Total Posts: 1077 |
|
|
| 24 Sep 2015 04:11 PM |
No, busy. Str is the name of the string to add and text is the original value. You could change it to object.Name, or whatveer you want.
"Use mine."
What is so much better about yours lmao?
@xlaser
Don't expect all code to be handed on a silver platter. OBVIOUSLY, you need to define variables and an object reference. |
|
|
| Report Abuse |
|
|
xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
|
| 24 Sep 2015 04:12 PM |
mmmk i got it Ty
http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$639 Tx1,818 |
|
|
| Report Abuse |
|
|
xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
|
| 24 Sep 2015 04:13 PM |
"Don't expect all code to be handed on a silver platter. OBVIOUSLY, you need to define variables and an object reference."
uh
i have no responce
http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$639 Tx1,818 |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2015 04:14 PM |
| @BusyCity, Didn't even read. gone straight for the answer. |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2015 04:16 PM |
@insane Gotcha. @OP We were all a little unclear on your intentions. Try to state what you need a little better in your post.
-The [Guy] |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2015 05:41 AM |
Stymi, your script may have a downside.
If a part you're about to rename is already named, it won't reset it.
like:
local part = Instance.new("Part", game.Workspace) local text = part.Name local str = "Idk"
for i = 1, #str do text = text..str:sub(i, i) wait() end
Final Result: PartIdk
Just stating it. |
|
|
| Report Abuse |
|
|