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: Will this work?

Previous Thread :: Next Thread 
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
11 Apr 2012 11:39 PM
function onPlayerEntered(newPlayer)
newPlayer:WaitForDataReady()
newPlayer.stats.agility.Value = newPlayer:LoadNumber("agility")
end

function onPlayerLeave(oldPlayer)
oldPlayer:WaitForDataReady()
oldPlayer:SaveNumber("agility", oldPlayer.stats.agility.Value)
end

game.Players.PlayerAdded:connect(onPlayerEntered)
game.Players.PlayerRemoving:connect(onPlayerLeave)

when I use the start server and add players and make them leave it does not error but I cannot test if it will work in gane mode right now...
Report Abuse
Quovis is not online. Quovis
Joined: 24 Mar 2012
Total Posts: 494
11 Apr 2012 11:50 PM
Err, 'PlayerRemoving' Doesn't sound right, but don't take my word for it.
Report Abuse
litozinnamon is not online. litozinnamon
Joined: 21 Dec 2009
Total Posts: 891
11 Apr 2012 11:53 PM
You do not need :WaitForPlayerDataReady when the player leaves
Report Abuse
litozinnamon is not online. litozinnamon
Joined: 21 Dec 2009
Total Posts: 891
11 Apr 2012 11:53 PM
:WaitForDataReady*
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
12 Apr 2012 06:13 PM
@lito, it errored and said that it needed some sort of wait, I do not remember
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
12 Apr 2012 06:45 PM
bump
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