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
 

is there nice, detailed guide on datastores?

Previous Thread :: Next Thread 
UDizzle is not online. 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
alphaboy299 is not online. alphaboy299
Joined: 15 Jun 2013
Total Posts: 1496
27 Nov 2015 11:12 PM
Yes.https://scriptinghelpers.org/blog/saving-data
Report Abuse
UDizzle is not online. UDizzle
Joined: 21 Nov 2015
Total Posts: 24
27 Nov 2015 11:15 PM
thanks =) @alphaboy299
Report Abuse
mycheeze is not online. 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 is not online. UDizzle
Joined: 21 Nov 2015
Total Posts: 24
27 Nov 2015 11:33 PM
@mycheeze thanks for the info =)
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