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
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Faulty save script? -100 Quick R$

Previous Thread :: Next Thread 
8XY is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
19 Sep 2014 02:15 PM
Can you use DataPersistence in a StartServer?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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