lulified
|
  |
| Joined: 05 Mar 2016 |
| Total Posts: 16 |
|
|
| 25 Dec 2016 09:36 AM |
I ran into trouble. Somebody had told me i was using GetAsync wrong so i changed it but it still doesn't work. Suggestions or ideas on how i can fix this?
local DataStore = game#########################################################cal Players = game.ServerStorage.Players
game.Players.PlayerAdded:Connect(function(Player) local Key = Player.UserId local UnResetableStats = Players:WaitForChild(Player.Name).UnResetableStats local ResetableStats = Players:WaitForChild(Player.Name).ResetableStats for i,v in pairs(ResetableStats:GetChildren()) do local PStats = DataStore:GetAsync(Key) if PStats then v.Value = PStats end; end; end);
game.Players.PlayerRemoving:Connect(function(Player) local Key = Player.UserId local UnResetableStats = Players:WaitForChild(Player.Name).UnResetableStats local ResetableStats = Players:WaitForChild(Player.Name).ResetableStats for i,v in pairs(UnResetableStats:GetChildren()) do DataStore:SetAsync(Key, v.Value) end; for i,v in pairs(ResetableStats:GetChildren()) do DataStore:SetAsync(Key, v.Value) end; end);
|
|
|
| Report Abuse |
|
|
|
| 25 Dec 2016 09:40 AM |
| I suggest you learn to make your titles clean and simple |
|
|
| Report Abuse |
|
|
lulified
|
  |
| Joined: 05 Mar 2016 |
| Total Posts: 16 |
|
|
| 25 Dec 2016 09:42 AM |
They are clean and simple, idk what your talking about.
|
|
|
| Report Abuse |
|
|
lulified
|
  |
| Joined: 05 Mar 2016 |
| Total Posts: 16 |
|
|
| 25 Dec 2016 09:57 AM |
I tried saving 1 value and it worked but i cant save all of them using a loop. How would i do this?
|
|
|
| Report Abuse |
|
|
|
| 26 Dec 2016 03:29 PM |
"So i was trying to learn how to make my own DataStores and.." Very clear and simple, it was to the point and I didnt need to read the description to figure out the problem |
|
|
| Report Abuse |
|
|