Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 01 Mar 2015 12:31 PM |
Here is the script, does it look correct? Also can I save within the playerGui?
local one = game.Players.LocalPlayer.PlayerGui.inv1.Value.Value local two= game.Players.LocalPlayer.PlayerGui.inv2.Value.Value local three= game.Players.LocalPlayer.PlayerGui.inv3.Value.Value local four= game.Players.LocalPlayer.PlayerGui.inv4.Value.Value local five= game.Players.LocalPlayer.PlayerGui.inv5.Value.Value
local DataStore = game:GetService("DataStoreService"):GetDataStore("Points")
local connection = DataStore:OnUpdate(oldvalue1, function(value) local key = "user_" .. player.userId local val1 = player.PlayerGui.Inv1.Value.Value DataStore:UpdateAsync(key, function(oldvalue1) local newValue1 = oldValue1 or {0,0,0,0,0} newValue1 = {one,two,three,four,five} return newValue1 end) end)
"Think of the biggest number you can, you are worth more than that." -Seeumliam |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 12:33 PM |
| Your function under OnUpdate will only run when the data is changed. The data is only changed in that function, meaning that data will never change. |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 01 Mar 2015 01:25 PM |
I know I haven't added the part of when it updates, but can I run a save when the player leaves inside the playerGui?
"Think of the biggest number you can, you are worth more than that." -Seeumliam |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 01 Mar 2015 02:13 PM |
How would I make it save say every 5 minutes? like while wait(200) do and then put the function after it?
"Think of the biggest number you can, you are worth more than that." -Seeumliam |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 01 Mar 2015 05:18 PM |
bump
"Think of the biggest number you can, you are worth more than that." -Seeumliam |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 01 Mar 2015 06:08 PM |
bump
"Think of the biggest number you can, you are worth more than that." -Seeumliam |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 01 Mar 2015 09:38 PM |
bump
"Think of the biggest number you can, you are worth more than that." -Seeumliam |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 01 Mar 2015 10:10 PM |
| Also the way your saving it everyone will have the same value. |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 01 Mar 2015 10:15 PM |
How would I save it so everyone gets there own save?
"Think of the biggest number you can, you are worth more than that." -Seeumliam |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 02 Mar 2015 09:52 AM |
Aren't I saving it to the persons username?
"Think of the biggest number you can, you are worth more than that." -Seeumliam |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 02 Mar 2015 03:21 PM |
bump
"Think of the biggest number you can, you are worth more than that." -Seeumliam |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 02 Mar 2015 06:26 PM |
bump
"Think of the biggest number you can, you are worth more than that." -Seeumliam |
|
|
| Report Abuse |
|
|
|
| 02 Mar 2015 06:32 PM |
That is a really poor way to handle saving/loading and all the other fun stuff.
Try my Module in my libraries and create your own based off it if u will.
http://www.roblox.com/My/Sets.aspx?id=1453358 |
|
|
| Report Abuse |
|
|