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

Previous Thread :: Next Thread 
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
22 Aug 2013 06:59 PM
Would this work?

game.Players.PlayerAdded:connect(function(player)
player:WaitForDataReady()
leaderstats = Instance.new("Model",player)
leaderstats.Name = "Leaderstats"
experience = Instance.new("IntValue",player)
experience.Name = "Experience"
experience.Value = player:LoadNumber("Experience")
end)

game.Players.PlayerRemoving:connect(function(player)
if player.DataReady then
player:SaveNumber("Experience",player.Leaderstats.Experience.Value)
end
end)

Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
22 Aug 2013 07:00 PM
Yes, that should work.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
22 Aug 2013 07:02 PM
Doesn't leaderstats have to be lowercase?
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
22 Aug 2013 07:15 PM
It doesnt create the leaderstats

Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
22 Aug 2013 07:18 PM
@cnt I dont want it to create a leaderboard

Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
22 Aug 2013 07:18 PM
Whoops, I missed an error, change the experience line to this:
experience = Instance.new("IntValue", player.Leaderstats)

@cnt, I think you can name the parent stat whatever you want.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
22 Aug 2013 07:18 PM
I thought he wanted it on the Roblox leaderboard c:
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
22 Aug 2013 07:19 PM
This is my script, I didnt even bother with creating the leaderstats Instance. Its only a value for a GUI
game.Players.PlayerAdded:connect(function(player)
player:WaitForDataReady()
experience = Instance.new("IntValue",player)
experience.Name = "Experience"
experience.Value = player:LoadNumber("Experience")
end)

game.Players.PlayerRemoving:connect(function(player)
if player.DataReady then
player:SaveNumber("Experience",player..Experience.Value)
end
end)




Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
22 Aug 2013 07:19 PM
Oh, you don't? Well then I don't think you need that 'Leaderstats' model.
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
22 Aug 2013 07:20 PM
player:SaveNumber("Experience",player.Experience.Value)
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
22 Aug 2013 07:26 PM
Its not instancing the values into player

Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
22 Aug 2013 07:31 PM
Im testing it in start server>start player

Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes
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