ns001111
|
  |
| Joined: 15 Jan 2011 |
| Total Posts: 2849 |
|
|
| 27 Jul 2011 07:01 AM |
How do you add something to a string? EX: ban = ("Joe", "Bob")
Say I want to add "Jordan" to the list. How would I? |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 27 Jul 2011 07:04 AM |
| Your script would error right there. You must learn what tables are.. you should try starting from the beginning because you seem to be missing important coding knowledge. I would suggest Dingdong272's BEGINNER Tutorials for now. |
|
|
| Report Abuse |
|
|
ns001111
|
  |
| Joined: 15 Jan 2011 |
| Total Posts: 2849 |
|
|
| 27 Jul 2011 07:06 AM |
| I should have known not to come here... |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 27 Jul 2011 07:09 AM |
Okay, I guess I'll tell you what's wrong. You're table is wrong. Tables are set up like this:
table = {} --notice how I use brackets
Now, this is how you set a long list of values to a table
brick = game.Workspace.Brick table = {1, "Hi", 563, brick, "HIIIIIIIIIIIII"} --see how I separate every key by a comma character?
|
|
|
| Report Abuse |
|
|
|
| 27 Jul 2011 07:10 AM |
Yeah, because this is the wrong place for asking for help. -_-
-My hand is a dolphin |
|
|
| Report Abuse |
|
|
ns001111
|
  |
| Joined: 15 Jan 2011 |
| Total Posts: 2849 |
|
|
| 27 Jul 2011 07:12 AM |
@Mega
It's Scripting Helpers. -_-
@Flurite
I know, but how would I add to it without stating the number. Like this: ban = {"Joe", "Bob"} ban[3] = "Jordan"
But the way my ban script goes, I don't know which number it's going to be. How can i just add it to the end of the list? If this is wrong, the wiki is wrong. |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2011 07:31 AM |
I'm pretty sure this was in scripters.
Maybe I'm blind or this was moved.
-My hand is a dolphin |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 27 Jul 2011 09:28 AM |
@OP
You just fired a metamethod right there! :O But that's probably not what you're looking for...
Use the table.insert table function to add keys into a table. Ex:
a = {1, "Hi", 33}
table.insert(a, 1, 5555)
Now, if you loop through the table and print all its values, this is what you should get:
5555 1 "Hi" 33
You can read the Wiki for more help. |
|
|
| Report Abuse |
|
|