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
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
|
| 31 Dec 2014 11:18 AM |
| You could use a module script. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|