UDizzle
|
  |
| Joined: 21 Nov 2015 |
| Total Posts: 24 |
|
|
| 27 Nov 2015 11:10 PM |
| i've read the wiki multiple times now but it really hasn't clicked yet. any thread/video that explains datastores properly? |
|
|
| Report Abuse |
|
|
| 27 Nov 2015 11:12 PM |
| Yes.https://scriptinghelpers.org/blog/saving-data |
|
|
| Report Abuse |
|
UDizzle
|
  |
| Joined: 21 Nov 2015 |
| Total Posts: 24 |
|
| |
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 27 Nov 2015 11:20 PM |
( ͡° ͜ʖ ͡°) let me dumb it down for people like U & I, and basically most other vowels
>now this right here, this here is the service
local Service = game:GetService'DataStoreService'
and there is a cheeky method that allows you to get a datastore (because apparently you can have multiple datastores for organization)
:GetDataStore( Datastore name )
so what we do this this
local DataStore = game:GetService'DataStoreService':GetDataStore'Pizza_Time'
think of this data store as a folder, a folder that contains the records of everything archived into it, but you can have multiple folders, even folders with the same records.
Now lets try this in action
local Store = game:GetService'DataStoreService':GetDataStore'Folder' game.Players.PlayerAdded:connect(function(P) local K = tostring(P.UserId) or 'hue' print(K) end)
Now what this will do is this will get the 'folder' and look for the archives of the player who joined the game, using their user Id as a key to get that data, without a key, it is like going into a folder and grabbing a file of the first thing you touched, instead of actually sorting through it.
I also put an 'or' so that way, if the folder doesn't have their data, it will overwrite 'K' as 'hue'
( ͡° ͜ʖ ͡°) |
|
|
| Report Abuse |
|
UDizzle
|
  |
| Joined: 21 Nov 2015 |
| Total Posts: 24 |
|
|
| 27 Nov 2015 11:33 PM |
| @mycheeze thanks for the info =) |
|
|
| Report Abuse |
|