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: Data Store and tables

Previous Thread :: Next Thread 
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
17 Jan 2015 12:18 AM
I was just wondering, is it possible to use Data Store to save a table when something is added/removed(changed) and to load it when the server starts?

Ex:

Playerlist = {"some1","some2","some3"}

How can I make this save when something is inserted(table.insert)/removed(table.remove) and load when the server starts?
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
17 Jan 2015 12:40 AM
Anyone?
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
17 Jan 2015 12:45 AM
I tried making a table.Changed event; failed.

I'd just recommend a loop with a large delay time (5-10 minutes) to auto-save the table, or a function when you admin someone in-game or remove them as admin, it will save the table to the DataStore with the new adminList. When the script runs in-game, just use DataStore:GetDataStore() to get the saved adminList, if theres no adminList; make a function to use the script's adminList.
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
17 Jan 2015 01:41 AM
So what would it look like?
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
17 Jan 2015 01:56 AM
How would I use data store on a table?
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
17 Jan 2015 02:26 AM
blah:SetAsync(key, {tab, tab, tiewioewieroewioerwioewrioerwioewrioewrioewioewio})
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
17 Jan 2015 06:39 AM
Make a string of the table, then save the string. I did it
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
17 Jan 2015 11:53 AM
Datastore's can save tables, numbers, and strings.

local DataStore=game:service'DataStore':GetDataStore'somerandomkey'

local adminList={
'Player1',
'Telamon',
'ROBLOX'
}

if DataStore:GetAsync'Admin List'then
if adminList~=DataStore:GetAsync'Admin List'then
adminList=DataStore:GetAsync'Admin List'
end
else
DataStore:SetAsync('Admin List',adminList)
end
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
17 Jan 2015 06:45 PM
Oh I see, so you can just use the variable of the table and make that the key for Data Store. Thanks everyone!
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