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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|