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 » Scripters
Home Search
 

Re: In pairs reading a table from a string value?

Previous Thread :: Next Thread 
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
30 Dec 2014 09:43 PM
Is it possible to have a central table for multiple scripts, like this:

-- Server Storage
--- StringValue1: {"1","2"}

-- Many scripts:

table = serverstorage.stringvalue1.value
for i,v in pairs (table) do

-- Yes, the script isnt finished and I shortened the table line

I tried the above but it doesnt work, because "it is expecting a table". Is there a way to make a centralized table like I want to? Or do I have to manually edit each script?
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
31 Dec 2014 11:14 AM
b
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
31 Dec 2014 11:18 AM
You could use a module script.
Report Abuse
512GB is not online. 512GB
Joined: 19 Apr 2012
Total Posts: 4271
31 Dec 2014 11:19 AM
Hmmm.

I would use JSON to encode it, put it in a stringvalue, and decode it in another script. The HTTPService has these JSON functions.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
31 Dec 2014 11:34 AM
Try
for v in table:gmatch('"(.-)"') do

Although I don't think that works (Haven't looked at gmatch like that for a while)
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
31 Dec 2014 11:37 AM
I wouldn't bother trying to tokenize. That probably won't work for non-numeric keys anyway. EncodeJSON and DecodeJSON. You have to import a library for it so check the wiki.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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