|
| 06 Mar 2014 09:59 PM |
local ds = game:GetService("DataStoreService"):GetDataStore(name, scope)
What is name and scope? I dont understand those 2 main parts, I think I dont understand how to use data store...
●▂▂● |
|
|
| Report Abuse |
|
|
JTrozzo
|
  |
| Joined: 05 Apr 2011 |
| Total Posts: 646 |
|
|
| 06 Mar 2014 10:22 PM |
| you need to load the data onto the script your running for the parts. It ends the script that for the joints to stop working. It will store the data onto your local drive. Good luck! |
|
|
| Report Abuse |
|
|
lsparks
|
  |
| Joined: 12 Mar 2014 |
| Total Posts: 14 |
|
|
| 07 Mar 2014 11:03 AM |
Name is just the name you want the Data Store to use. Scope is the name of a collection of data stores. Unless your game is very complex, you can usually just define the name and leave the scope part blank. This will put your data store in a special scope called "general". So for instance if I wanted to make a data store to hold player experience, I might access the data store like this:
local ds = game:GetService("DataStoreService"):GetDataStore("playerexpstore") |
|
|
| Report Abuse |
|
|
Cawlonee
|
  |
| Joined: 03 Mar 2014 |
| Total Posts: 2687 |
|
|
| 07 Mar 2014 12:20 PM |
According to the wiki, if you don't specify a scope, it goes to "global" not "general"...
I'm really curious to see which is correct.
http://wiki.roblox.com/index.php/Data_store#GetDataStore.28name.2C_scope_.3D_.22global.22.29 |
|
|
| Report Abuse |
|
|
Aphyllous
|
  |
| Joined: 18 Sep 2013 |
| Total Posts: 300 |
|
|
| 07 Mar 2014 12:25 PM |
@lsparks
let's say the datastore "abcdefg" didn't exist;
if i tried to use :GetDataStore("abcdefg") would it return nil or create a new datastore with that name? |
|
|
| Report Abuse |
|
|
lsparks
|
  |
| Joined: 12 Mar 2014 |
| Total Posts: 14 |
|
|
| 07 Mar 2014 02:40 PM |
@Cawlonee: You are 100% right. It is "global". It was early when I wrote that response. Maybe I should start drinking coffee...
@Aphyllous: GetDataStore will never return nil. The data store will be created if it doesn't exist already. |
|
|
| Report Abuse |
|
|
|
| 07 Mar 2014 02:41 PM |
| Its like GetService then?:P |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2014 07:36 PM |
Ok thanks. So how exactly do you save a string value? Im really confused.
●▂▂● |
|
|
| Report Abuse |
|
|
| |
|
Cawlonee
|
  |
| Joined: 03 Mar 2014 |
| Total Posts: 2687 |
|
|
| 16 Mar 2014 06:00 AM |
| hax @ lsparks post date and join date. |
|
|
| Report Abuse |
|
|