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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: I need help with Datastore

Previous Thread :: Next Thread 
Valheira is not online. Valheira
Joined: 18 Feb 2014
Total Posts: 15
13 Mar 2017 11:40 AM
Hi ive tried out this datastore thing, but couldnt get it to work. All i need is for the tools and leaderboard to save when i go to a different roblox universe under the game. Does anyone have a working datastore script? Ive tried using this model made by a roblox admin (name censors for me) but i either didnt figure it out, or it doesnt work - https://www.roblox.com/library/159129148/PlayerDataStore-Module Also where would i put those modules in studio?
Report Abuse
galio13 is not online. galio13
Joined: 20 Jul 2011
Total Posts: 842
13 Mar 2017 12:59 PM
game.Players.PlayerAdded:connect(function(plr) local Datastore = ################################### local DS = Datastore:GetDataStore(plr.UserId) local cash = DS:GetAsync("Cash") local toolname = DS:GetAsync("Toolname") if cash ~= nil then if toolname ~= nil then plr.leaderstats.Cash.Value = cash local Tool = game.Replicated:FindFirstChild(toolname):Clone() Tool.Parent = plr.Backpack end end end)
Report Abuse
Valheira is not online. Valheira
Joined: 18 Feb 2014
Total Posts: 15
13 Mar 2017 01:00 PM
Thanks so much for replying, what's the censored part?
Report Abuse
galio13 is not online. galio13
Joined: 20 Jul 2011
Total Posts: 842
13 Mar 2017 01:00 PM
Of course to get data store will be filtered with roblox' bad filter system.

Just search up datastore and find out how to get it. Then the rest will work.
Report Abuse
galio13 is not online. galio13
Joined: 20 Jul 2011
Total Posts: 842
13 Mar 2017 01:04 PM
http://wiki.roblox.com/index.php?title=Data_store
Report Abuse
Valheira is not online. Valheira
Joined: 18 Feb 2014
Total Posts: 15
13 Mar 2017 01:17 PM
Okay and lastly, when I put all this into a script, where would I put that script? ServerScriptService?
Report Abuse
galio13 is not online. galio13
Joined: 20 Jul 2011
Total Posts: 842
13 Mar 2017 01:26 PM
Preferably ServerScriptService.


When life gives you lemonade. Give the lemonades back to life! What am I supposed to with lemons?
Report Abuse
Valheira is not online. Valheira
Joined: 18 Feb 2014
Total Posts: 15
13 Mar 2017 01:31 PM
The tools and leaderboard stats still do not save in different universes for me. :(
Report Abuse
galio13 is not online. galio13
Joined: 20 Jul 2011
Total Posts: 842
13 Mar 2017 01:35 PM
game.Players.PlayerAdded:connect(function(plr) local Datastore = ################################### local DS = Datastore:GetDataStore(plr.UserId) local cash = DS:GetAsync("Cash") local toolname = DS:GetAsync("Toolname") if cash ~= nil then if toolname ~= nil then plr.leaderstats.Cash.Value = cash local Tool = game.Replicated:FindFirstChild(toolname):Clone() Tool.Parent = plr.Backpack end end end) game.Players.PlayerLeft:connect(function(plr) local Datastorre = ################################### local Cdata = Datastorre:GetDataStore(plr.UserId) local LS = plr.leaderstats local sCash = LS.Cash.Value local tool = plr.Backpack.Toolname Cdata:SetAsync("Cash", sCash) Cdata:SetAsync("Toolname",tool.Name) end) When life gives you lemonade. Give the lemonades back to life! What am I supposed to with lemons?
Report Abuse
galio13 is not online. galio13
Joined: 20 Jul 2011
Total Posts: 842
13 Mar 2017 01:35 PM
it's game.Players.PlayerRemoving:connect(function(plr)


When life gives you lemonade. Give the lemonades back to life! What am I supposed to with lemons?
Report Abuse
Valheira is not online. Valheira
Joined: 18 Feb 2014
Total Posts: 15
13 Mar 2017 01:49 PM
I couldn't get that to work either. I tried replacing the PlayersLeft to PlayersRemoving, as well as removing the extra "R"'s in "local Datastorre = " "local ##### = Datastorre:GetDataStore" -----Thanks for the help you put in btw. I really hate this new thread format
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