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: I don't know why these won't work. Can I have some help?

Previous Thread :: Next Thread 
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
19 Nov 2011 05:57 PM
game.Players.PlayerRemoving:connect(function(plr)
plr:WaitForDataReady()
p = plr:FindFirstChild("Points")
if p then
plr:SaveNumber("Points",p.Value)
end
end)

--^--*Save*--

game.Players.PlayerAdded:connect(function(plr)
plr:WaitForDataReady()
--[[p = Instance.new("NumberValue")
p.Name = "Points"]]
p = plr:LoadNumber("Points")
pnts = plr:FindFirstChild("Points")
if pnts then
pnts.Value = p
end
end)

--^--*Load*--
Report Abuse
sk8ercool456 is not online. sk8ercool456
Joined: 24 Jan 2008
Total Posts: 1846
19 Nov 2011 06:43 PM
In the first one, the player's data is already loaded so you don't need the WaitForDataReady. That may cause the script to run later and not be able to save the player's data.
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
19 Nov 2011 10:39 PM
No, http://wiki.roblox.com/index.php/Data_Persistence_Complete_Guide it has WaitForDataReady even there.
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
19 Nov 2011 10:49 PM
Bump.
Report Abuse
noobertuber is not online. noobertuber
Joined: 16 Jan 2007
Total Posts: 2321
19 Nov 2011 10:53 PM
What does the output read? If it doesn't read anything, then the problem might be that, as the wiki says, the player removing function is too short to use. Try making a constant saver in the form of a GUI.

Sincerely,
Noobertuber
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
19 Nov 2011 11:22 PM
Dude, how am I supposed to get an output?
Report Abuse
TigerBloodd is not online. TigerBloodd
Joined: 24 Oct 2010
Total Posts: 2430
19 Nov 2011 11:57 PM
@flappydavid
make an output gui like i did
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