8XY
|
  |
| Joined: 05 Jan 2014 |
| Total Posts: 186 |
|
|
| 19 Sep 2014 01:49 PM |
game.Players.PlayerRemoving:connect(function(p) if p:findFirstChild("leaderstats") then p:SaveInstance("SavedStatPNum"..tostring(game.PlaceId),p.leaderstats) end end) game.Players.PlayerAdded:connect(function(p) for k = 1, 60, 0.03 do wait() if p:findFirstChild("leaderstats") and p.DataReady then break end end local Loaded = nil if p:findFirstChild("leaderstats") and pcall(function() Loaded = p:LoadInstance("SavedStatPNum"..tostring(game.PlaceId)) end) then for j, v in pairs(Loaded:GetChildren()) do pcall(function() p.leaderstats[v.Name].Value = v.Value end) end end end)
It seems like it only saves other players points like 80% of the time, anyone have a clue why that is?
100 R$ for anyone that answers the correctly, +100 more for a link to a savescript that works correctly? |
|
|
| Report Abuse |
|
|
Nyxis
|
  |
| Joined: 15 Nov 2012 |
| Total Posts: 3374 |
|
|
| 19 Sep 2014 01:51 PM |
| uhmm the only think I could offer you is to put prints throughout the script and find out where it's stopping |
|
|
| Report Abuse |
|
|
8XY
|
  |
| Joined: 05 Jan 2014 |
| Total Posts: 186 |
|
|
| 19 Sep 2014 01:59 PM |
| i guess, but it works sometimes and sometimes doesnt |
|
|
| Report Abuse |
|
|
8XY
|
  |
| Joined: 05 Jan 2014 |
| Total Posts: 186 |
|
|
| 19 Sep 2014 02:04 PM |
| and it saves when you leave so how would i tell? just wait till someone leaves and hope it doesnt work for them so i can know what's wrong? |
|
|
| Report Abuse |
|
|
Nyxis
|
  |
| Joined: 15 Nov 2012 |
| Total Posts: 3374 |
|
|
| 19 Sep 2014 02:15 PM |
| Can you use DataPersistence in a StartServer? |
|
|
| Report Abuse |
|
|