generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Remote Banlist Help

Previous Thread :: Next Thread 
DrWaffler is not online. DrWaffler
Joined: 16 Sep 2011
Total Posts: 4248
10 Jul 2013 05:32 AM
Haha, was just talking about this, and how Tables are my mortal enemy.

So if I had a large string, structured so names were separated by spaces.

Example:

"player1 drwaffler player2 shedletsky"

How would I insert the values into a table, so it would return.

for k,v in pairs(MyTable) do
print(k,v)
end

With the output of

1 player1
2 drwaffler
3 player2
4 shedletsky

Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
10 Jul 2013 05:37 AM
    local t = {};
    for name in str:gmatch("(%a+)%s?") do
        t[#t+1] = name
    end

I didnt test that, see if it works
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
10 Jul 2013 05:41 AM
local Table = { }

for Word in String:gmatch("%w+") do
table.insert(Table, Word)
end
Report Abuse
DrWaffler is not online. DrWaffler
Joined: 16 Sep 2011
Total Posts: 4248
10 Jul 2013 05:42 AM
Care explaining to me the spazzy symbols involved with that?

The wiki just says "Here, put these in, we aren't going to tell you their meaning at all"
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
10 Jul 2013 05:43 AM
http://www.lua.org/pil/20.2.html

yeah %w+ is better
Report Abuse
DrWaffler is not online. DrWaffler
Joined: 16 Sep 2011
Total Posts: 4248
10 Jul 2013 05:48 AM
Thanks for that link! It did a great job of explaining it. Tables aren't my enemy here, only lack of relevant information.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image